2005-03-08  Jan Beulich  <jbeulich@novell.com>

	* config/tc-ia64.c (parse_section_name): Rename to...
	(cross_section): In addition to separating the name from the rest of
	the arguments, also carry out the operation.
	(dot_xdata): Use cross_section.
	(dot_float_cons): Likewise.
	(dot_xstringer): Likewise.
	(dot_xdata_ua): Likewise.
	(dot_float_cons_ua): Likewise. Pass float_cons, not stmt_float_cons.

gas/testsuite/
2005-03-08  Jan Beulich  <jbeulich@novell.com>

	* gas/ia64/xdata.[sd], gas/ia64/xdata-ilp32.d: New.
	* gas/ia64/ia64.exp: Run new tests.
This commit is contained in:
Jan Beulich 2005-03-08 08:23:32 +00:00
parent 0b74f93c04
commit ef6a2b4181
7 changed files with 186 additions and 68 deletions

View file

@ -1,3 +1,14 @@
2005-03-08 Jan Beulich <jbeulich@novell.com>
* config/tc-ia64.c (parse_section_name): Rename to...
(cross_section): In addition to separating the name from the rest of
the arguments, also carry out the operation.
(dot_xdata): Use cross_section.
(dot_float_cons): Likewise.
(dot_xstringer): Likewise.
(dot_xdata_ua): Likewise.
(dot_float_cons_ua): Likewise. Pass float_cons, not stmt_float_cons.
2005-03-05 Alan Modra <amodra@bigpond.net.au>
* po/gas.pot: Regenerate.

View file

@ -765,7 +765,7 @@ static void dot_byteorder PARAMS ((int));
static void dot_psr PARAMS ((int));
static void dot_alias PARAMS ((int));
static void dot_ln PARAMS ((int));
static char *parse_section_name PARAMS ((void));
static void cross_section PARAMS ((int ref, void (*cons) PARAMS((int)), int ua));
static void dot_xdata PARAMS ((int));
static void stmt_float_cons PARAMS ((int));
static void stmt_cons_ua PARAMS ((int));
@ -4757,58 +4757,75 @@ dot_ln (dummy)
demand_empty_rest_of_line ();
}
static char *
parse_section_name ()
static void
cross_section (ref, cons, ua)
int ref;
void (*cons) PARAMS((int));
int ua;
{
char *name;
int len;
char *start, *end;
int saved_auto_align;
unsigned int section_count;
SKIP_WHITESPACE ();
if (*input_line_pointer == '"')
start = input_line_pointer;
if (*start == '"')
{
int len;
char *name;
name = demand_copy_C_string (&len);
obstack_free(&notes, name);
if (!name)
{
ignore_rest_of_line ();
return;
}
}
else
{
char *start = input_line_pointer;
char c = get_symbol_end ();
if (input_line_pointer == start)
{
as_bad ("Missing section name");
ignore_rest_of_line ();
return 0;
return;
}
name = obstack_copy (&notes, start, input_line_pointer - start + 1);
*input_line_pointer = c;
}
if (!name)
{
ignore_rest_of_line ();
return 0;
}
end = input_line_pointer;
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
as_bad ("Comma expected after section name");
ignore_rest_of_line ();
return 0;
return;
}
++input_line_pointer; /* skip comma */
return name;
*end = '\0';
end = input_line_pointer + 1; /* skip comma */
input_line_pointer = start;
md.keep_pending_output = 1;
section_count = bfd_count_sections(stdoutput);
obj_elf_section (0);
if (section_count != bfd_count_sections(stdoutput))
as_warn ("Creating sections with .xdataN/.xrealN/.xstringZ is deprecated.");
input_line_pointer = end;
saved_auto_align = md.auto_align;
if (ua)
md.auto_align = 0;
(*cons) (ref);
if (ua)
md.auto_align = saved_auto_align;
obj_elf_previous (0);
md.keep_pending_output = 0;
}
static void
dot_xdata (size)
int size;
{
char *name = parse_section_name ();
if (!name)
return;
md.keep_pending_output = 1;
set_section (name);
cons (size);
obj_elf_previous (0);
md.keep_pending_output = 0;
cross_section (size, cons, 0);
}
/* Why doesn't float_cons() call md_cons_align() the way cons() does? */
@ -4854,66 +4871,28 @@ static void
dot_xfloat_cons (kind)
int kind;
{
char *name = parse_section_name ();
if (!name)
return;
md.keep_pending_output = 1;
set_section (name);
stmt_float_cons (kind);
obj_elf_previous (0);
md.keep_pending_output = 0;
cross_section (kind, stmt_float_cons, 0);
}
static void
dot_xstringer (zero)
int zero;
{
char *name = parse_section_name ();
if (!name)
return;
md.keep_pending_output = 1;
set_section (name);
stringer (zero);
obj_elf_previous (0);
md.keep_pending_output = 0;
cross_section (zero, stringer, 0);
}
static void
dot_xdata_ua (size)
int size;
{
int saved_auto_align = md.auto_align;
char *name = parse_section_name ();
if (!name)
return;
md.keep_pending_output = 1;
set_section (name);
md.auto_align = 0;
cons (size);
md.auto_align = saved_auto_align;
obj_elf_previous (0);
md.keep_pending_output = 0;
cross_section (size, cons, 1);
}
static void
dot_xfloat_cons_ua (kind)
int kind;
{
int saved_auto_align = md.auto_align;
char *name = parse_section_name ();
if (!name)
return;
md.keep_pending_output = 1;
set_section (name);
md.auto_align = 0;
stmt_float_cons (kind);
md.auto_align = saved_auto_align;
obj_elf_previous (0);
md.keep_pending_output = 0;
cross_section (kind, float_cons, 1);
}
/* .reg.val <regname>,value */

View file

@ -1,3 +1,8 @@
2005-03-08 Jan Beulich <jbeulich@novell.com>
* gas/ia64/xdata.[sd], gas/ia64/xdata-ilp32.d: New.
* gas/ia64/ia64.exp: Run new tests.
2005-03-08 Jan Beulich <jbeulich@novell.com>
* gas/ia64/pcrel.d: Account for big endian target.

View file

@ -64,10 +64,12 @@ if [istarget "ia64-*"] then {
run_dump_test "secname-ilp32"
run_dump_test "unwind-ilp32"
run_dump_test "alias-ilp32"
run_dump_test "xdata-ilp32"
} else {
run_dump_test "secname"
run_dump_test "unwind"
run_dump_test "alias"
run_dump_test "xdata"
run_dump_test "group-1"
}

View file

@ -0,0 +1,29 @@
#readelf: -S
#name: ia64 xdata (ilp32)
#as: -milp32
#source: xdata.s
There are 19 section headers, starting at offset 0x[[:xdigit:]]+:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] .text PROGBITS 00000000 [[:xdigit:]]+ 000000 00 AX 0 0 16
\[ 2\] .data PROGBITS 00000000 [[:xdigit:]]+ 000000 00 WA 0 0 1
\[ 3\] .bss NOBITS 00000000 [[:xdigit:]]+ 000000 00 WA 0 0 1
\[ 4\] \.xdata1 PROGBITS 00000000 [[:xdigit:]]+ 000001 00 A 0 0 1
\[ 5\] \.xdata2 PROGBITS 00000000 [[:xdigit:]]+ 000004 00 A 0 0 2
\[ 6\] ,xdata3 PROGBITS 00000000 [[:xdigit:]]+ 000008 00 A 0 0 4
\[ 7\] \.xdata,4 PROGBITS 00000000 [[:xdigit:]]+ 000010 00 A 0 0 8
\[ 8\] "\.xdata5" PROGBITS 00000000 [[:xdigit:]]+ 000020 00 A 0 0 16
\[ 9\] \.rela"\.xdata5" RELA 00000000 [[:xdigit:]]+ 000018 0c 17 8 4
\[10\] \.xreal\\1 PROGBITS 00000000 [[:xdigit:]]+ 000008 00 A 0 0 4
\[11\] \.xreal\+2 PROGBITS 00000000 [[:xdigit:]]+ 000010 00 A 0 0 8
\[12\] \.xreal\(3\) PROGBITS 00000000 [[:xdigit:]]+ 000014 00 A 0 0 16
\[13\] \.xreal\[4\] PROGBITS 00000000 [[:xdigit:]]+ 000020 00 A 0 0 16
\[14\] \.xstr<1> PROGBITS 00000000 [[:xdigit:]]+ 000003 00 A 0 0 1
\[15\] \.xstr\{2\} PROGBITS 00000000 [[:xdigit:]]+ 000004 00 A 0 0 1
\[16\] .shstrtab STRTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 00 0 0 1
\[17\] .symtab SYMTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 10 18 15 4
\[18\] .strtab STRTAB 00000000 [[:xdigit:]]+ [[:xdigit:]]+ 00 0 0 1
#pass

View file

@ -0,0 +1,47 @@
#readelf: -S
#name: ia64 xdata
There are 19 section headers, starting at offset 0x[[:xdigit:]]+:
Section Headers:
\[Nr\] Name Type Address Offset
Size EntSize Flags Link Info Align
\[ 0\] NULL 0000000000000000 [[:xdigit:]]+
0000000000000000 0000000000000000 0 0 0
\[ 1\] \.text PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000000 0000000000000000 AX 0 0 16
\[ 2\] \.data PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000000 0000000000000000 WA 0 0 1
\[ 3\] \.bss NOBITS 0000000000000000 [[:xdigit:]]+
0000000000000000 0000000000000000 WA 0 0 1
\[ 4\] \.xdata1 PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000001 0000000000000000 A 0 0 1
\[ 5\] \.xdata2 PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000004 0000000000000000 A 0 0 2
\[ 6\] ,xdata3 PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000008 0000000000000000 A 0 0 4
\[ 7\] \.xdata,4 PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000010 0000000000000000 A 0 0 8
\[ 8\] "\.xdata5" PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000020 0000000000000000 A 0 0 16
\[ 9\] \.rela"\.xdata5" RELA 0000000000000000 [[:xdigit:]]+
0000000000000030 0000000000000018 17 8 8
\[10\] \.xreal\\1 PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000008 0000000000000000 A 0 0 4
\[11\] \.xreal\+2 PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000010 0000000000000000 A 0 0 8
\[12\] \.xreal\(3\) PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000014 0000000000000000 A 0 0 16
\[13\] \.xreal\[4\] PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000020 0000000000000000 A 0 0 16
\[14\] \.xstr<1> PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000003 0000000000000000 A 0 0 1
\[15\] \.xstr\{2\} PROGBITS 0000000000000000 [[:xdigit:]]+
0000000000000004 0000000000000000 A 0 0 1
\[16\] \.shstrtab STRTAB 0000000000000000 [[:xdigit:]]+
[[:xdigit:]]+ 0000000000000000 0 0 1
\[17\] \.symtab SYMTAB 0000000000000000 [[:xdigit:]]+
[[:xdigit:]]+ 0000000000000018 18 15 8
\[18\] \.strtab STRTAB 0000000000000000 [[:xdigit:]]+
[[:xdigit:]]+ 0000000000000000 0 0 1
#pass

View file

@ -0,0 +1,45 @@
// Note that most of the section names used here aren't legal as operands
// to either .section or .xdata/.xreal/.xstring (quoted strings aren't in
// general), but since generic code accepts them for .section we also test
// this here for our target specific directives. This could be viewed as a
// shortcut of a pair of .section/.secalias for each of them.
.section .xdata1, "a", @progbits
.section ".xdata2", "a", @progbits
.section ",xdata3", "a", @progbits
.section ".xdata,4", "a", @progbits
.section "\".xdata5\"", "a", @progbits
.section ".xreal\\1", "a", @progbits
.section ".xreal+2", "a", @progbits
.section ".xreal(3)", "a", @progbits
.section ".xreal[4]", "a", @progbits
.section ".xstr<1>", "a", @progbits
.section ".xstr{2}", "a", @progbits
.text
.xdata1 .xdata1, 1
.xdata2 ".xdata2", 2
.xdata4 ",xdata3", 3
.xdata8 ".xdata,4", 4
.xdata16 "\".xdata5\"", @iplt(_start)
.xdata2.ua ".xdata2", 2
.xdata4.ua ",xdata3", 3
.xdata8.ua ".xdata,4", 4
.xdata16.ua "\".xdata5\"", @iplt(_start)
.xreal4 ".xreal\\1", 1
.xreal8 ".xreal+2", 2
.xreal10 ".xreal(3)", 3
.xreal16 ".xreal[4]", 4
.xreal4.ua ".xreal\\1", 1
.xreal8.ua ".xreal+2", 2
.xreal10.ua ".xreal(3)", 3
.xreal16.ua ".xreal[4]", 4
.xstring ".xstr<1>", "abc"
.xstringz ".xstr{2}", "xyz"