From 886e427f80b5affa2b54287a10e749675d0214c2 Mon Sep 17 00:00:00 2001 From: Michael Eager Date: Tue, 18 Dec 2012 16:01:02 +0000 Subject: PR ld/14736 bfd: * elf32-microblaze.c (calc_fixup): Add end range. gas/testsuite: * gas/microblaze/relax_size.exp: New file - test object size after linker relaxation * gas/microblaze/relax_size.s: Likewise * gas/microblaze/relax_size.elf: Likewise * gas/microblaze/relax_size2.s: Likewise * gas/microblaze/relax_size2.elf: Likewise --- gas/testsuite/ChangeLog | 9 ++++++++ gas/testsuite/gas/microblaze/relax_size.elf | 32 ++++++++++++++++++++++++++ gas/testsuite/gas/microblaze/relax_size.exp | 25 ++++++++++++++++++++ gas/testsuite/gas/microblaze/relax_size.s | 7 ++++++ gas/testsuite/gas/microblaze/relax_size2.elf | 34 ++++++++++++++++++++++++++++ gas/testsuite/gas/microblaze/relax_size2.s | 11 +++++++++ 6 files changed, 118 insertions(+) create mode 100644 gas/testsuite/gas/microblaze/relax_size.elf create mode 100644 gas/testsuite/gas/microblaze/relax_size.exp create mode 100644 gas/testsuite/gas/microblaze/relax_size.s create mode 100644 gas/testsuite/gas/microblaze/relax_size2.elf create mode 100644 gas/testsuite/gas/microblaze/relax_size2.s (limited to 'gas/testsuite') diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index b24baef..884e10f 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2012-12-18 David Holsgrove + + * gas/microblaze/relax_size.exp: New file - test object size after linker + relaxation + * gas/microblaze/relax_size.s: Likewise + * gas/microblaze/relax_size.elf: Likewise + * gas/microblaze/relax_size2.s: Likewise + * gas/microblaze/relax_size2.elf: Likewise + 2012-12-17 Nick Clifton * config/default.exp: Add copyright notice. diff --git a/gas/testsuite/gas/microblaze/relax_size.elf b/gas/testsuite/gas/microblaze/relax_size.elf new file mode 100644 index 0000000..cf23ea6 --- /dev/null +++ b/gas/testsuite/gas/microblaze/relax_size.elf @@ -0,0 +1,32 @@ + +Symbol table '.symtab' contains 29 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND + 1: 00000050 0 SECTION LOCAL DEFAULT 1 + 2: 00000058 0 SECTION LOCAL DEFAULT 2 + 3: 00000000 0 FILE LOCAL DEFAULT ABS relax_size.o + 4: 00000050 8 NOTYPE LOCAL DEFAULT 1 func + 5: 00000058 0 NOTYPE LOCAL DEFAULT 1 label + 6: 00000000 0 FILE LOCAL DEFAULT ABS + 7: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _fdata + 8: 00000058 0 NOTYPE GLOBAL DEFAULT 1 _etext + 9: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _essrw + 10: 00000058 0 NOTYPE GLOBAL DEFAULT 1 _heap_end + 11: 00000058 0 NOTYPE GLOBAL DEFAULT 1 _heap_start + 12: 00000000 0 NOTYPE GLOBAL DEFAULT ABS _ssro_size + 13: 00000050 0 NOTYPE GLOBAL DEFAULT 1 _ftext + 14: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _essro + 15: 00000400 0 NOTYPE GLOBAL DEFAULT ABS _STACK_SIZE + 16: 00000000 0 NOTYPE GLOBAL DEFAULT ABS _HEAP_SIZE + 17: 00000000 0 NOTYPE GLOBAL DEFAULT ABS _ssrw_size + 18: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _stack_end + 19: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _edata + 20: 00000458 0 NOTYPE GLOBAL DEFAULT 2 _end + 21: 00000058 0 NOTYPE GLOBAL DEFAULT 1 _heap + 22: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _ssro + 23: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _ssrw + 24: 00000458 0 NOTYPE GLOBAL DEFAULT 2 _stack + 25: 00000050 0 NOTYPE GLOBAL DEFAULT ABS _TEXT_START_ADDR + 26: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _frodata + 27: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _fbss + 28: 00000058 0 NOTYPE GLOBAL DEFAULT 2 _erodata diff --git a/gas/testsuite/gas/microblaze/relax_size.exp b/gas/testsuite/gas/microblaze/relax_size.exp new file mode 100644 index 0000000..a733dc8 --- /dev/null +++ b/gas/testsuite/gas/microblaze/relax_size.exp @@ -0,0 +1,25 @@ + +proc ld_run { objects ldflags dest test } { + set ld_output [target_link $objects $dest $ldflags] +} + +proc readelf_run { exec flags dest test } { + set readelf [find_binutils_prog readelf] + verbose -log "$readelf $flags $exec > $dest" + catch "exec $readelf $flags $exec > $dest" readelf_output +} + +proc regexp_test { file1 file2 test } { + if [regexp_diff $file1 $file2] then { fail $test } else { pass $test } +} + +global srcdir subdir +if [istarget microblaze*-*-elf] { + foreach file [lsort [glob -nocomplain -- $srcdir/$subdir/relax_size*.s]] { + set file [file rootname [file tail $file]] + gas_run "$file.s" "-o $file.o" "" + ld_run "$file.o" "-e 0 -N -relax" "$file.x" "linking $file.x" + readelf_run "$file.x" "-s" "$file.elf" "readelf -s $file.x" + regexp_test "$file.elf" "$srcdir/$subdir/$file.elf" "matching $file.elf" + } +} diff --git a/gas/testsuite/gas/microblaze/relax_size.s b/gas/testsuite/gas/microblaze/relax_size.s new file mode 100644 index 0000000..6b25977 --- /dev/null +++ b/gas/testsuite/gas/microblaze/relax_size.s @@ -0,0 +1,7 @@ + .org 0 + .section .text +func: + braid label + nop +label: + .size func, . - func diff --git a/gas/testsuite/gas/microblaze/relax_size2.elf b/gas/testsuite/gas/microblaze/relax_size2.elf new file mode 100644 index 0000000..fbdcc0a --- /dev/null +++ b/gas/testsuite/gas/microblaze/relax_size2.elf @@ -0,0 +1,34 @@ + +Symbol table '.symtab' contains 31 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND + 1: 00000050 0 SECTION LOCAL DEFAULT 1 + 2: 00000060 0 SECTION LOCAL DEFAULT 2 + 3: 00000000 0 FILE LOCAL DEFAULT ABS relax_size2.o + 4: 00000050 4 NOTYPE LOCAL DEFAULT 1 func + 5: 00000054 0 NOTYPE LOCAL DEFAULT 1 label + 6: 00000054 8 NOTYPE LOCAL DEFAULT 1 func2 + 7: 0000005c 0 NOTYPE LOCAL DEFAULT 1 label2 + 8: 00000000 0 FILE LOCAL DEFAULT ABS + 9: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _fdata + 10: 0000005c 0 NOTYPE GLOBAL DEFAULT 1 _etext + 11: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _essrw + 12: 00000060 0 NOTYPE GLOBAL DEFAULT 1 _heap_end + 13: 00000060 0 NOTYPE GLOBAL DEFAULT 1 _heap_start + 14: 00000000 0 NOTYPE GLOBAL DEFAULT ABS _ssro_size + 15: 00000050 0 NOTYPE GLOBAL DEFAULT 1 _ftext + 16: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _essro + 17: 00000400 0 NOTYPE GLOBAL DEFAULT ABS _STACK_SIZE + 18: 00000000 0 NOTYPE GLOBAL DEFAULT ABS _HEAP_SIZE + 19: 00000000 0 NOTYPE GLOBAL DEFAULT ABS _ssrw_size + 20: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _stack_end + 21: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _edata + 22: 00000460 0 NOTYPE GLOBAL DEFAULT 2 _end + 23: 00000060 0 NOTYPE GLOBAL DEFAULT 1 _heap + 24: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _ssro + 25: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _ssrw + 26: 00000460 0 NOTYPE GLOBAL DEFAULT 2 _stack + 27: 00000050 0 NOTYPE GLOBAL DEFAULT ABS _TEXT_START_ADDR + 28: 0000005c 0 NOTYPE GLOBAL DEFAULT 2 _frodata + 29: 00000060 0 NOTYPE GLOBAL DEFAULT 2 _fbss + 30: 0000005c 0 NOTYPE GLOBAL DEFAULT 2 _erodata diff --git a/gas/testsuite/gas/microblaze/relax_size2.s b/gas/testsuite/gas/microblaze/relax_size2.s new file mode 100644 index 0000000..dedabfb --- /dev/null +++ b/gas/testsuite/gas/microblaze/relax_size2.s @@ -0,0 +1,11 @@ + .org 0 + .section .text +func: + nop +label: + .size func, . - func +func2: + braid label2 + nop +label2: + .size func2, . - func2 -- cgit v1.1