summaryrefslogtreecommitdiffstats
path: root/gold/testsuite/memory_test.t
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-09-08 16:10:33 +0000
committerNick Clifton <nickc@redhat.com>2010-09-08 16:10:33 +0000
commit7f8cd8440375de26ebca766ab281c34522262b53 (patch)
treeada43984d6bc35a3487c093cb6b1c5b1a988527b /gold/testsuite/memory_test.t
parentab3e2b4a1c329818752fe855215d81fe21f88a8b (diff)
downloadppe42-binutils-7f8cd8440375de26ebca766ab281c34522262b53.tar.gz
ppe42-binutils-7f8cd8440375de26ebca766ab281c34522262b53.zip
* README: Remove claim that MEMORY is not supported.
* expression.cc (script_exp_function_origin) (script_exp_function_length): Move from here to ... * script.cc: ... here. (script_set_section_region, script_add_memory) (script_parse_memory_attr, script_include_directive): New functions. * script-sections.cc (class Memory_region): New class. (class Output_section_definition): Add set_memory_region, set_section_vma, set_section_lma and get_section_name methods. (class Script_Sections): Add add_memory_region, find_memory_region, find_memory_region_origin, find_memory_region_length and set_memory_region methods. Have set_section_addresses method walk the list of set memory regions. Extend the print methos to display memory regions. * script-sections.h: Add prototypes for new methods. Add enum for MEMORY region attributes. * yyscript.y: Add support for parsing MEMORY regions. * script-c.h: Add prototypes for new functions. * testsuite/Makefile.am: Add test of MEMORY region functionality. * testsuite/Makefile.in: Regenerate. * testsuite/memory_test.sh: New script. * testsuite/memory_test.s: New assembler source file. * testsuite/memory_test.t: New linker script.
Diffstat (limited to 'gold/testsuite/memory_test.t')
-rw-r--r--gold/testsuite/memory_test.t29
1 files changed, 29 insertions, 0 deletions
diff --git a/gold/testsuite/memory_test.t b/gold/testsuite/memory_test.t
new file mode 100644
index 0000000000..7bcb877e52
--- /dev/null
+++ b/gold/testsuite/memory_test.t
@@ -0,0 +1,29 @@
+MEMORY
+{
+ region1 : ORIGIN = 0x1000, LENGTH = 0x1000 ,
+ region2 (r) : org = 0x2000, len = 300
+ region3 (wx) : o = 0x4000, l = 4
+ region4 (!r) : o = 0x6000 + 60, len = 0x30 * 0x6
+}
+
+SECTIONS
+{
+ .sec0 : { *(*.sec0) }
+
+ .sec1 ORIGIN (region1) : AT(LENGTH (region2)) { *(*.sec1) }
+
+ fred = ORIGIN (region1) + LENGTH (region1) ;
+
+ .sec2 : { *(*.sec2) } > region3 AT> region4
+
+ .sec3 0x5000 : { *(*.sec3) }
+
+ /* In theory we could put:
+
+ /DISCARD/ : { *(*) }
+
+ here as we do not need any other sections for this test.
+ In practice however doing so breaks GOLD as it relies upon
+ being able to create/find various other sections such as
+ .dynamic, .dynsym and .gnu.hash. */
+}
OpenPOWER on IntegriCloud