Commit Graph

129 Commits

Author SHA1 Message Date
Nick Clifton 52b010e442 * config/tc-h8300.c (h8300_elf_section): New function - issue a
warning message if a new section is created without setting any
        attributes for it.
        (md_pseudo_table): Intercept section creation pseudos.
        (md_pcrel_from): Replace abort with an error message.
        * config/obj-elf.c (obj_elf_section_name): Export this function.
        * config/obj-elf.h (obj_elf_section_name): Prototype.

        * gas/elf/section0.d: Skip this test for the h8300.
        * gas/elf/section1.d: Likewise.
        * gas/elf/section6.d: Likewise.
        * gas/elf/elf.exp: Skip section2 and section5 tests when the
        target is the h8300.

        * ld-scrips/sort.exp: Skip these tests when the target is the
        h8300.
2010-01-13 14:08:54 +00:00
Nick Clifton fad84867f9 * ld-elf/extract-symbol-1sec.d: Expect to fail for the RX target.
* ld-scripts/overlay-size.d: Likewise.
        * ld-scripts/rgn-at1.d: Likewise.
        * ld-scripts/rgn-at2.d: Likewise.
        * ld-scripts/rgn-at3.d: Likewise.
        * ld-scripts/rgn-at4.d: Likewise.
        * ld-scripts/rgn-over8-ok.d: Likewise.
2009-11-18 16:37:56 +00:00
Alan Modra 4879cf1683 * ld-scripts/phdrs3.exp (LDFLAGS): Add "--local-store 0:0" for SPU. 2009-11-02 03:44:20 +00:00
Arnold Metselaar 6c293e26a3 * coff-z80.c (z80coff_vec): Allow sections to be of type SEC_CODE or SEC_DATA
* ld-scripts/align.exp: Remove xfails for z80-*-coff
2009-10-17 17:18:28 +00:00
Joseph Myers 0aa3b0e6e6 * ld-scripts/phdrs3.d: Allow colon in name of linker binary. 2009-10-14 23:12:16 +00:00
H.J. Lu b9ed7c0818 2009-10-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10744
	* ld-scripts/phdrs3.exp: Run phdrs3a.

	* ld-scripts/phdrs3a.d: New.
	* ld-scripts/phdrs3a.t: Likewise.
2009-10-08 02:38:26 +00:00
Alan Modra 09a1697895 PR ld/10744
* ld-scripts/phdrs3.d: Update.
2009-10-08 01:11:56 +00:00
Nathan Sidwell 5c1a3f0fa7 ld/
* ldlang.c (lang_new_phdr): Check PHDRS and FILEHDR in loadable
	segments do not appear after a different loadable segment.
	* ld.texinfo (PHDRS): Document order of processing segments.
	Document where PHDRS and FILEHDR may appear.

	ld/testsuite/
	* ld-scripts/phdrs3.d: New.
	* ld-scripts/phdrs3.t: New.
	* ld-scripts/phdrs3.exp: New.
2009-10-07 07:25:36 +00:00
Alan Modra 53b0eb27a9 * ld-elf/sec64k.exp: For frv-linux use "aw" sections.
* ld-elf/seg.d: Cater for GNU_STACK segment.
	* ld-elf/symbol1ref.s: Use data section.
	* ld-elf/symbol2ref.s: Likewise.
	* ld-scripts/empty-address-1.d: Don't run on frv-linux.
	* ld-scripts/empty-address-2a.d: Likewise.
	* ld-scripts/empty-address-2b.d: Likewise.
	* ld-scripts/empty-aligned.d: Likewise.
	* ld-elf/extract-symbol-1sym.d: Tolerate extra target supplied syms.
	* ld-scripts/sort_b_a-1.d: Likewise.
	* ld-scripts/sort_b_a.d: Likewise.
	* ld-scripts/sort_b_a_a-1.d: Likewise.
	* ld-scripts/sort_b_a_a-2.d: Likewise.
	* ld-scripts/sort_b_a_a-3.d: Likewise.
	* ld-scripts/sort_b_a_n-1.d: Likewise.
	* ld-scripts/sort_b_a_n-2.d: Likewise.
	* ld-scripts/sort_b_a_n-3.d: Likewise.
	* ld-scripts/sort_b_n-1.d: Likewise.
	* ld-scripts/sort_b_n.d: Likewise.
	* ld-scripts/sort_b_n_a-1.d: Likewise.
	* ld-scripts/sort_b_n_a-2.d: Likewise.
	* ld-scripts/sort_b_n_a-3.d: Likewise.
	* ld-scripts/sort_b_n_n-1.d: Likewise.
	* ld-scripts/sort_b_n_n-2.d: Likewise.
	* ld-scripts/sort_b_n_n-3.d: Likewise.
	* ld-scripts/sort_no-1.d: Likewise.
	* ld-scripts/sort_no-2.d: Likewise.
2009-09-09 12:13:42 +00:00
Alan Modra aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Hans-Peter Nilsson cfdf6d77ef * ld-scripts/empty-address-3a.d, ld-scripts/empty-address-3b.d:
Skip for mmix-knuth-mmixware.
2009-07-30 00:13:55 +00:00
Hans-Peter Nilsson 2a1314ce69 * ld-scripts/default-script.s (text): Globalize.
* ld-scripts/default-script1.d, ld-scripts/default-script2.d,
	ld-scripts/default-script3.d, ld-scripts/default-script4.d: Adjust
	accordingly.
2009-07-29 06:47:48 +00:00
Kai Tietz 204eb8bc8b 2009-06-25 Kai Tietz <kai.tietz@onevision.com>
* ld-pe/aligncomm-1.c (size_t): Add typedef.
	(main): Use it for casting pointer to scalar.
	* ld-pe/aligncomm-2.c: Likewise.
	* ld-pe/aligncomm-3.c: Likewise.
	* ld-pe/aligncomm-4.c: Likewise.
	* ld-scripts/empty-address.exp: Make sure that for x86_64-*-mingw*
	target imagebase is set to zero.
	* ld-scripts/weak.exp: Don't fail for x86_64-*-mingw* target.
2009-06-25 14:41:18 +00:00
Hans-Peter Nilsson cb150213b2 * ld-scripts/rgn-over7.d: Adjust expected message for recent change. 2009-05-22 15:54:36 +00:00
Nathan Sidwell ec6d26bed6 * ldlang.c (lang_check_section_addresses): Ignore non-loadable
sections when checking for overlap.  Clarify error message
	concerns load address.

	testsuite/
	* ld-scripts/rgn-at4.t: New.
	* ld-scripts/rgn-at4.d: New.
2009-05-22 11:27:44 +00:00
Alan Modra 32e9651ca5 Missed from my 2009-04-16 commit 2009-05-21 06:13:28 +00:00
Nathan Sidwell d577356088 * ld-scripts/rgn-at1.d: Cope with larger padding on sections.
* ld-scripts/rgn-at2.d: Likewise.
	* ld-scripts/rgn-at3.d: Likewise.
2009-04-22 11:57:35 +00:00
Nathan Sidwell 6c03179c32 * ld-scripts/rgn-at.s: Use explicit .section pseudos. 2009-04-03 10:15:21 +00:00
Nathan Sidwell 113e68452e * ldlang.c (lang_leave_output_section_statement): Set lma_region
if it is not overridden and section is for the same vma region as
	the previous section.

	* ld-scripts/rgn-at.exp: New.
	* ld-scripts/rgn-at.s: New.
	* ld-scripts/rgn-at1.d: New.
	* ld-scripts/rgn-at1.t: New.
	* ld-scripts/rgn-at2.d: New.
	* ld-scripts/rgn-at2.t: New.
	* ld-scripts/rgn-at3.d: New.
	* ld-scripts/rgn-at3.t: New.
2009-04-03 07:45:28 +00:00
Nick Clifton 4a93e18003 * ldgram.y: Add support for REGION_ALIAS operator.
* ldlang.c: Likewise.
        * ldlang.h: Likewise.
        * ldlex.l: Likewise.
        * NEWS: Mention the new feature.
        * ld.texinfo: Document the new feature.
        * ld-scripts/regions-alias-1.t: New file.
        * ld-scripts/regions-alias-2.t: New file.
        * ld-scripts/regions-alias-3.t: New file.
        * ld-scripts/regions-alias-4.t: New file.
        * ld-scripts/script.exp: Run region alias tests.
2009-03-02 17:27:36 +00:00
Alan Modra e497069013 * ld-elf/elf.exp: Save and restore LDFLAGS.
* ld-scripts/default-script.exp: Likewise.
	* ld-scripts/empty-orphan.exp: Likewise, and add to LDFLAGS rather
	than replacing.
	* ld-scripts/include.exp: Set --local-store for SPU.
2009-01-12 13:57:59 +00:00
Alan Modra 1ce4cec447 * ld-scripts/include.exp: Don't run test for aout.
* ld-scripts/include.s: Use .fill rather than .4byte.
	* ld-scripts/include-1.d: Adjust.
2008-07-26 01:23:37 +00:00
Nick Clifton 5b9f75a8ae * ld-scripts/include-sections.t: Discard all sections not
explicitly requested by the rest of the linker script.
        * ld-scripts/include-1.d: Expect test to fail for AIX ports.
        Do not assume that the .text section will be marked readonly.
        * ld-scripts/include.s: Replace .section directives with just
        .text or .data.
2008-07-21 08:38:35 +00:00
Nathan Sidwell 4006703d71 * ld.texinfo (File Commands): Document that INCLUDE can be used in
several different places.
	* ldgram.y (statement, memory_spec, section): Allow INCLUDE.
	(memory, memory_spec_list): Simplify BNF
	(memory_spec_list_opt): New rule.
	* ldlex.l (INCLUDE): Recognize in EXPRESSION.
testsuite/
	* ld-scripts/include-1.d: New.
	* ld-scripts/include-1.t: New.
	* ld-scripts/include-data.t: New.
	* ld-scripts/include-mem.t: New.
	* ld-scripts/include-ram.t: New.
	* ld-scripts/include-sections.t: New.
	* ld-scripts/include-subdata.t: New.
	* ld-scripts/include.exp: New.
	* ld-scripts/include.s: New.
2008-07-06 13:38:37 +00:00
Nick Clifton 5590fba953 * ldlang.c (print_output_section_statement): If the output section
statement has an update_dot_tree expression, apply it to
        print_dot.
        (print_input_section): Do not update print_dot if it would move
        print_dot backwards.
        (lang_do_assignments_1): If the output section statement has an
        update_dot_tree expression apply it to dot.

  * ld-scripts/overlay-size.t (end_of_bss_overlays): Define.
  (end_of_text_overlays): Define.
  (end_of_data_overlays): Define.
  * ld-scripts/overlay-size-map.d: Add expected values for
  end_of_bss_overlays, end_of_text_overlays and
  end_of_data_overlays.
2008-06-12 11:27:38 +00:00
Mike Frysinger 9cbdce76ab 2008-05-03 Mike Frysinger <vapier@gentoo.org>
* ld-scripts/defined.s: Use .set syntax rather than =.
2008-05-03 06:19:19 +00:00
H.J. Lu e76b98d759 2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
PR ld/6475
	* ld-scripts/rgn-over8-ok.d: Accept any alignment.
2008-05-02 15:11:49 +00:00
Nathan Sidwell ed1831c09d * ld-scripts/rgn-over8.s: Tweak. 2008-04-28 14:08:15 +00:00
Nathan Sidwell a2cab75396 ld/
* ldlang.c (lang_size_sections_1): Don't check LMA overflow on
	non-load sections.
ld/testsuite/
	* ld-scripts/rgn-over.exp: Allow -ok file names to pass.
	* ld-scripts/rgn-over8.s: New.
	* ld-scripts/rgn-over8.t: New.
	* ld-scripts/rgn-over8-ok.d: New.
2008-04-28 12:45:34 +00:00
Alan Modra 58b9344cf3 * ld-scripts/rgn-over.exp: Add --no-overlays for spu. 2007-12-14 21:54:50 +00:00
Danny Smith 11ec4ba977 include
* coff/pe.h (COFF_ENCODE_ALIGNMENT) Define.

gas
	* read.c (ALIGN_LIMIT): Rename to ...
	(TC_ALIGN_LIMIT): Guard against prior definition.
	* config/tc-i386.h (TC_ALIGN_LIMIT)[TE_PE]: Define.

bfd
	* pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Let .data, .text
	 and .bss section use the default.
	* pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.

ld/testsuite
	* ld-scripts/align.exp: Enable for PECOFF.
	* ld-scripts/alignof.exp: Likewise.
2007-11-04 23:49:09 +00:00
Alan Modra c4b21a5f4c * ld-scripts/rgn-over1.d: Accept extra LOAD at end of map file.
* ld-scripts/rgn-over2.d: Likewise.
	* ld-scripts/rgn-over3.d: Likewise.
	* ld-scripts/rgn-over4.d: Likewise.
	* ld-scripts/rgn-over5.d: Likewise.
	* ld-scripts/rgn-over6.d: Likewise.
	* ld-scripts/rgn-over7.d: Likewise.
2007-10-26 06:40:25 +00:00
Daniel Jacobowitz 20e5635130 2007-10-17 Zack Weinberg <zack@codesourcery.com>
* ldlang.c (lang_check_section_addresses): Also report size of
	overflow for any overflowed memory regions.
	(os_region_check): Diagnose an overflowed region only once per
	region.  Do not reset region->current on overflow.

2007-10-17  Zack Weinberg  <zack@codesourcery.com>
	    Daniel Jacobowitz  <dan@codesourcery.com>
	    Mark Shinwell  <shinwell@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* ld-scripts/rgn-over.exp: New driver.
	* ld-scripts/rgn-over.s: New file.
	* ld-scripts/rgn-over1.d, ld-scripts/rgn-over1.t,
	ld-scripts/rgn-over2.d, ld-scripts/rgn-over2.t,
	ld-scripts/rgn-over3.d, ld-scripts/rgn-over3.t,
	ld-scripts/rgn-over4.d, ld-scripts/rgn-over4.t,
	ld-scripts/rgn-over5.d, ld-scripts/rgn-over5.t,
	ld-scripts/rgn-over6.d, ld-scripts/rgn-over6.t,
	ld-scripts/rgn-over7.d, ld-scripts/rgn-over7.t:
	New test cases.
2007-10-17 19:26:10 +00:00
Nick Clifton 4dcdce139f * ld-scripts/crossref.exp: Compile test source with -mtiny=0 in order to
prevent the use of the small data area.
2007-09-19 09:22:07 +00:00
Nick Clifton a1438fce30 * ldlang.c (lang_map): Increment lang_statement_iteration so that DEFINED() expressions are correctly computed.
* testsuite/ld-script/map-address.d,
* testsuite/ld-script/map-address.t: Add a test for testing DEFINED in map output.
2007-08-31 14:46:55 +00:00
Joseph Myers 7f6a71ffb6 bfd:
2007-08-28  Mark Shinwell  <shinwell@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* elf32-arm.c (elf32_arm_compare_mapping): Compare first on vma,
	then on type.

binutils/testsuite:
2007-08-28  Mark Shinwell  <shinwell@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* binutils-all/ar.exp (long_filenames): Delete temporary files on
	the host.
	* binutils-all/arm/objdump.exp: Only check "which $OBJDUMP" if
	host is local.
	* binutils-all/objcopy.exp: Use ${srecfile} to get the name of the
	srec file to be passed to binutils_run.
	(objcopy_test_readelf): Use remote_exec.
	* binutils-all/readelf.exp (readelf_find_size): Use remote_exec.
	(readelf_test): Likewise.
	(readelf_wi_test): Likewise.
	* lib/utils-lib.exp (run_dump_test): Only check "which $binary" if
	host is local.  Use remote_exec.  Use $tempfile not
	tmpdir/bintest.o.

gas:
2007-08-28  Mark Shinwell  <shinwell@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* as.c (main): Flush stderr before printing listings to ensure
	consistent output order across platforms.

gas/testsuite:
2007-08-28  Mark Shinwell  <shinwell@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* lib/gas-defs.exp (gas_version): Use remote_* functions instead
	of exec.
	(gas_host_run): New.
	(gas_run): Use gas_host_run.
	(gas_start): Likewise.
	(run_dump_test): Likewise.
	(objdump): Use gas_host_run.
	(objdump_start_no_subdir): Likewise.
	* lib/gas-dg.exp (gas-dg-test): Use "remote_file host delete".
	* lib/run: Remove.
	* gas/macros/macros.exp: Download app4b.s to host.
	* gas/i386/i386.exp (gas_64_check): Use gas_host_run.
	(gas_32_check): Likewise.
	* gas/maxq10/maxq10.exp (gas_64_check): Likewise
	(gas_32_check): Likewise.
	* gas/maxq20/maxq20.exp (gas_64_check): Likewise
	(gas_32_check): Likewise.
	* gas/sparc/sparc.exp (gas_64_check): Likewise.
	* gas/cfi/cfi.exp: Likewise.
	* gas/elf/elf.exp (run_list_test): Likewise.  Use temporary file
	for readelf output in place of pipe.
	* gas/all/gas.exp: Download incbin.dat to host.
	(do_comment): Allow \r\r\n.

ld:
2007-08-28  Mark Shinwell  <shinwell@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* ldlang.c (sort_sections_by_lma): Sort by internal id after lma
	for stable sort.

ld/testsuite:
2007-08-28  Mark Shinwell  <shinwell@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* ld-elfcomm/elfcomm.exp: Use run_host_cmd.  Only check "which
	$CC" if host is local.
	* ld-checks/checks.exp: Use run_host_cmd.
	* ld-elf/exclude.exp: Likewise.
	* ld-elf/elf.exp: Download merge.ld if host is remote.
	* ld-elf/binutils.exp (binutils_test): Use remote_exec.
	* ld-elf/tls_common.exp: Use run_host_cmd.
	* lib/ld-lib.exp (ld_version): Only check "which $ld" if host is
	local.  Use remote_exec.
	(run_host_cmd): New.
	(run_host_cmd_yesno): New.
	(default_ld_relocate): Use run_host_cmd_yesno.
	(default_ld_link): Likewise.
	(default_ld_simple_link): Use run_host_cmd.
	(default_ld_compile): Only check "which $ccprog" if host is local.
	Use remote_file and remote_exec.
	(default_ld_assemble): Only check "which $as" if host is local.
	Use run_host_cmd.
	(default_ld_nm): Use remote_exec, remote_upload and remote_file.
	(run_dump_test): Use remote_exec, remote_upload and remote_file.
	Only check "which $binary" if host is local.
	(run_ld_link_tests): Use remote_exec, remote_upload and
	remote_file.
	* ld-selective/selective.exp: Only check "which $CXX" if host is
	local.  Use remote_exec.
	* ld-scripts/phdrs.exp: Only check "which $objdump" if host is
	local.  Use run_host_cmd.
	* ld-scripts/phdrs2.exp: Likewise.
	* ld-scripts/weak.exp: Likewise.
	* ld-undefined/weak-undef.exp: Likewise.
	* ld-scripts/crossref.exp: Only check "which $CC" if host is local.
	Use run_host_cmd.
	* ld-scripts/map-address.exp: Upload map_address.map if host is
	remote.
	* ld-srec/srec.exp (run_srec_tests): Use run_host_cmd.  Only check
	"which $CC" and "which $CXX" if host is local.
	* ld-undefined/undefined.exp: Only check "which $CC" if host is
	local.  Use remote_file and run_host_cmd.
	* config/default.exp: Use remote_exec to create tmpdir.
2007-08-28 13:21:58 +00:00
Nathan Sidwell e0e1a5e8db * ld-scripts/assert.t: Tweak to avoid relying on empty's VMA being
zero.
2007-07-13 09:09:25 +00:00
Nick Clifton f96b4a7b0f Update sources to GPLv3 2007-07-06 14:09:45 +00:00
Nathan Sidwell 82c01eb610 * ld-scripts/alignof.exp: Skip on non-elf 2007-07-02 15:56:46 +00:00
H.J. Lu d431cc14f3 2007-06-29 H.J. Lu <hjl@gnu.org>
* ld-scripts/assert.t: Discard .reginfo sections.
2007-06-26 16:41:04 +00:00
Andreas Schwab 49e8a957c1 * ld-scripts/cross3.t: Add .opd section. 2007-06-18 18:53:45 +00:00
Nathan Sidwell 362c1d1a04 * ldlex.l, ldgram.y: Add ALIGNOF.
* ldexp.c (exp_print_token, foldname): Likewise.
	* ld.texinfo: Likewise.

	ld/testsuite/
	* ld-scripts/alignof.s: New.
	* ld-scripts/alignof.t: New
	* ld-scripts/alignof.exp: New.
2007-06-18 12:38:22 +00:00
Nathan Sidwell 8545d1a9dd * ldlex.l: ASSERT is recognized in SCRIPT env. NAMES cannot
contain commas in EXP env.
	* ldgram.y (extern_name_list): Push to EXP env, move body to ...
	(extern_name_list_body): ... here.
	(script_file, ifile_list): Reformat.
	(statement): Add ASSERT.
testsuite:
	* ld-scripts/assert.t: Add additional cases.
	* ld-scripts/extern.t, ld-scripts/extern.s,
	ld-scripts/extern.exp: New.
2007-05-24 09:24:09 +00:00
H.J. Lu a243fa9752 2007-02-13 H.J. Lu <hongjiu.lu@intel.com>
* ld-scripts/default-script1.d: Expect extra symbols.
	* ld-scripts/default-script2.d: Likewise.
	* ld-scripts/default-script3.d: Likewise.
	* ld-scripts/default-script4.d: Likewise.
2007-02-13 22:14:59 +00:00
Alan Modra b25b09cb7e * ld-scripts/default-script.exp: Add "--local-store 0:0" to
LDFLAGS for spu.
2007-02-01 05:12:11 +00:00
H.J. Lu 14be856495 ld/
2007-01-19 H.J. Lu  <hongjiu.lu@intel.com>

	* NEWS: Mention --default-script/-dT.

	* ld.h (args_type): Add a default_script field.

	* ld.texinfo: Document --default-script/-dT.

	* ldmain.c (main): Handle command_line.default_script.

	* lexsup.c (option_values): Add OPTION_DEFAULT_SCRIPT.
	(ld_options): Add entries for --default-script and -dT.
	(parse_args): Handle --default-script/-dT.

ld/testsuite/

2007-01-19 H.J. Lu  <hongjiu.lu@intel.com>

	* ld-scripts/default-script.exp: New file.
	* ld-scripts/default-script.s: Likewise.
	* ld-scripts/default-script.t: Likewise.
	* ld-scripts/default-script1.d: Likewise.
	* ld-scripts/default-script2.d: Likewise.
	* ld-scripts/default-script3.d: Likewise.
	* ld-scripts/default-script4.d: Likewise.
2007-01-19 14:51:27 +00:00
Nick Clifton 42037fe5bb Renamed target x86_64-*-mingw64 to x86_64-*-mingw*. 2007-01-08 17:21:50 +00:00
Nathan Sidwell cc3e2771c5 ld/
* ldexp.c (fold_name): Issue error on undefined sections.
ld/testsuite/
	* ld-scripts/expr.exp: New.
	* ld-scripts/expr1.s: New.
	* ld-scripts/expr1.d: New.
	* ld-scripts/expr1.t: New.
2007-01-06 22:03:46 +00:00
Alan Modra 67f744f3bc * ldlang.c (print_output_section_statement): Print load address
when lma differs from vma.
testsuite/
	* ld-scripts/overlay-size-map.d: Update.
2006-12-12 08:10:40 +00:00
Alan Modra e9f5312993 New Cell SPU port. 2006-10-25 06:49:21 +00:00