public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: PATCH: Don't allow ia64 unwind section to point to section in different files
@ 2005-05-18  7:02 Jan Beulich
  2005-05-18 13:58 ` H. J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2005-05-18  7:02 UTC (permalink / raw)
  To: hjl, wilson; +Cc: davidm, binutils

>I am checking with icc/ias people to see if we can find a common
>approach.

I hope you have better luck than me; I tried to get their attention to various of the things that weren't really clear, and never heard anything back...

Jan

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: PATCH: Don't allow ia64 unwind section to point to section in different files
@ 2005-05-18  7:23 Jan Beulich
  0 siblings, 0 replies; 21+ messages in thread
From: Jan Beulich @ 2005-05-18  7:23 UTC (permalink / raw)
  To: hjl, wilson; +Cc: davidm, binutils

>>> James E Wilson <wilson@specifixinc.com> 18.05.05 01:20:47 >>>
>The basic question here is whether it is ever OK for anything to come
>between the .proc and the function label.

Per ias, it is OK for code and/or data to come in there, but no unwind directives. For code like

.text
.proc test1, test2, test3
.prologue
.save ar.lc, r16
	mov		r16 = ar.lc
test2:
.save pr, r17
	mov		r17 = pr
test1:	
.save.b 0b00000010, r18
	mov		r18 = b1
test3:
	br.ret.sptk	rp
.endp test1, test2, test3

ias gives

unwind.s(14) : error A2145: the first unwind directive must point to the procedure test1 entry point

basically meaning that they check that no unwind stuff exists between .proc and the main entry point (and the region size covered
by the unwind info would then be set to just the range from the main entry point through .endp).

Further (regarding the original issue discussed here), they generate both relocations against the symbol, not the section. However, I too believe this is wrong, but I'm not sure if gas should intentionally behave differently here. Maybe that's another point to be discussed with them before settling on a solution.

Jan


^ permalink raw reply	[flat|nested] 21+ messages in thread
[parent not found: <s28af68c.020@emea1-mh.id2.novell.com>]
* Re: PATCH: Don't allow ia64 unwind section to point to section in different files
@ 2005-05-18 15:16 Jan Beulich
  2005-05-18 15:21 ` H. J. Lu
  2005-05-18 19:35 ` James E Wilson
  0 siblings, 2 replies; 21+ messages in thread
From: Jan Beulich @ 2005-05-18 15:16 UTC (permalink / raw)
  To: hjl, wilson; +Cc: davidm, binutils

[-- Attachment #1: Type: text/plain, Size: 3935 bytes --]

How about this change then?

Built and tested natively on ia64-unknown-linux-gnu and as cross tools
for ia64-hpux.

Jan

gas/
2005-05-18  Jan Beulich  <jbeulich@novell.com>

	* config/tc-ia64.c (dot_endp): Don't use global symbol for unwind
	relocations in unwind section.

gas/testsuite/
2005-05-18  Jan Beulich  <jbeulich@novell.com>

	* gas/ia64/reloc-uw.s: New.
	* gas/ia64/reloc-uw.d: New.
	* gas/ia64/reloc-uw-ilp32.d: New.
	* gas/ia64/ia64.exp: Run new test.

--- /home/jbeulich/src/binutils/mainline/2005-05-18/gas/config/tc-ia64.c	2005-05-09 08:31:38.000000000 +0200
+++ 2005-05-18/gas/config/tc-ia64.c	2005-05-18 15:47:16.019373692 +0200
@@ -4442,7 +4442,13 @@ dot_endp (dummy)
       e.X_op = O_pseudo_fixup;
       e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
       e.X_add_number = 0;
-      e.X_add_symbol = unwind.proc_start;
+      if (!S_IS_LOCAL (unwind.proc_start)
+	  && S_IS_DEFINED (unwind.proc_start))
+	e.X_add_symbol = symbol_temp_new (S_GET_SEGMENT (unwind.proc_start),
+					  S_GET_VALUE (unwind.proc_start),
+					  symbol_get_frag (unwind.proc_start));
+      else
+	e.X_add_symbol = unwind.proc_start;
       ia64_cons_fix_new (frag_now, where, bytes_per_address, &e);
 
       e.X_op = O_pseudo_fixup;
--- /home/jbeulich/src/binutils/mainline/2005-05-18/gas/testsuite/gas/ia64/ia64.exp	2005-05-09 08:31:39.000000000 +0200
+++ 2005-05-18/gas/testsuite/gas/ia64/ia64.exp	2005-05-18 15:47:16.020350255 +0200
@@ -65,11 +65,13 @@ if [istarget "ia64-*"] then {
 	run_dump_test "unwind-ilp32"
 	run_dump_test "alias-ilp32"
 	run_dump_test "xdata-ilp32"
+	run_dump_test "reloc-uw-ilp32"
     } else {
 	run_dump_test "secname"
 	run_dump_test "unwind"
 	run_dump_test "alias"
 	run_dump_test "xdata"
+	run_dump_test "reloc-uw"
 	run_dump_test "group-1"
 	run_dump_test "group-2"
     }
--- /home/jbeulich/src/binutils/mainline/2005-05-18/gas/testsuite/gas/ia64/reloc-uw-ilp32.d	1970-01-01 01:00:00.000000000 +0100
+++ 2005-05-18/gas/testsuite/gas/ia64/reloc-uw-ilp32.d	2005-05-18 15:06:17.000000000 +0200
@@ -0,0 +1,15 @@
+#objdump: -r
+#name: ia64 unwind relocations (ilp32)
+#as: -milp32
+#source: reloc-uw.s
+
+.*: +file format .*
+
+RELOCATION RECORDS FOR \[\.IA_64\.unwind\]:
+OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]*
+0*00 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*04 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*08 SEGREL32[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[048c])?
+0*0c SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*10 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*14 SEGREL32[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[048c])?
--- /home/jbeulich/src/binutils/mainline/2005-05-18/gas/testsuite/gas/ia64/reloc-uw.d	1970-01-01 01:00:00.000000000 +0100
+++ 2005-05-18/gas/testsuite/gas/ia64/reloc-uw.d	2005-05-18 15:05:55.000000000 +0200
@@ -0,0 +1,13 @@
+# objdump: -r
+# name: ia64 unwind relocations
+
+.*: +file format .*
+
+RELOCATION RECORDS FOR \[\.IA_64\.unwind\]:
+OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]*
+0*00 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*08 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*10 SEGREL64[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[08])?
+0*18 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*20 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*28 SEGREL64[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[08])?
--- /home/jbeulich/src/binutils/mainline/2005-05-18/gas/testsuite/gas/ia64/reloc-uw.s	1970-01-01 01:00:00.000000000 +0100
+++ 2005-05-18/gas/testsuite/gas/ia64/reloc-uw.s	2005-05-18 14:50:58.000000000 +0200
@@ -0,0 +1,13 @@
+	.text
+
+	.macro uw, type
+	.proc	uw\type
+	.\type	uw\type
+uw\type:
+	.unwentry
+	br.ret.sptk rp
+	.endp	uw\type
+	.endm
+
+	uw global
+	uw weak



[-- Attachment #2: binutils-2.16-ia64-unwind-reloc.patch --]
[-- Type: text/plain, Size: 3211 bytes --]

--- /usr/local/src/binutils-2.16/gas/config/tc-ia64.c	2005-04-20 20:41:36.000000000 +0200
+++ 2.16/gas/config/tc-ia64.c	2005-05-18 14:45:21.339640840 +0200
@@ -4420,7 +4420,13 @@ dot_endp (dummy)
       e.X_op = O_pseudo_fixup;
       e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym;
       e.X_add_number = 0;
-      e.X_add_symbol = unwind.proc_start;
+      if (!S_IS_LOCAL (unwind.proc_start)
+	  && S_IS_DEFINED (unwind.proc_start))
+	e.X_add_symbol = symbol_temp_new (S_GET_SEGMENT (unwind.proc_start),
+					  S_GET_VALUE (unwind.proc_start),
+					  symbol_get_frag (unwind.proc_start));
+      else
+	e.X_add_symbol = unwind.proc_start;
       ia64_cons_fix_new (frag_now, where, bytes_per_address, &e);
 
       e.X_op = O_pseudo_fixup;
--- /usr/local/src/binutils-2.16/gas/testsuite/gas/ia64/ia64.exp	2005-03-08 09:27:02.000000000 +0100
+++ 2.16/gas/testsuite/gas/ia64/ia64.exp	2005-05-18 15:00:46.112054064 +0200
@@ -65,11 +65,13 @@ if [istarget "ia64-*"] then {
 	run_dump_test "unwind-ilp32"
 	run_dump_test "alias-ilp32"
 	run_dump_test "xdata-ilp32"
+	run_dump_test "reloc-uw-ilp32"
     } else {
 	run_dump_test "secname"
 	run_dump_test "unwind"
 	run_dump_test "alias"
 	run_dump_test "xdata"
+	run_dump_test "reloc-uw"
 	run_dump_test "group-1"
     }
 
--- /usr/local/src/binutils-2.16/gas/testsuite/gas/ia64/reloc-uw-ilp32.d	1970-01-01 01:00:00.000000000 +0100
+++ 2.16/gas/testsuite/gas/ia64/reloc-uw-ilp32.d	2005-05-18 15:06:17.290707256 +0200
@@ -0,0 +1,15 @@
+#objdump: -r
+#name: ia64 unwind relocations (ilp32)
+#as: -milp32
+#source: reloc-uw.s
+
+.*: +file format .*
+
+RELOCATION RECORDS FOR \[\.IA_64\.unwind\]:
+OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]*
+0*00 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*04 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*08 SEGREL32[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[048c])?
+0*0c SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*10 SEGREL32[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*14 SEGREL32[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[048c])?
--- /usr/local/src/binutils-2.16/gas/testsuite/gas/ia64/reloc-uw.d	1970-01-01 01:00:00.000000000 +0100
+++ 2.16/gas/testsuite/gas/ia64/reloc-uw.d	2005-05-18 15:05:54.594157656 +0200
@@ -0,0 +1,13 @@
+# objdump: -r
+# name: ia64 unwind relocations
+
+.*: +file format .*
+
+RELOCATION RECORDS FOR \[\.IA_64\.unwind\]:
+OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]*
+0*00 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*08 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*10 SEGREL64[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[08])?
+0*18 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*20 SEGREL64[ML]SB[[:space:]]+\.text(\+0x[[:xdigit:]]*0)?
+0*28 SEGREL64[ML]SB[[:space:]]+\.IA_64\.unwind_info(\+0x[[:xdigit:]]*[08])?
--- /usr/local/src/binutils-2.16/gas/testsuite/gas/ia64/reloc-uw.s	1970-01-01 01:00:00.000000000 +0100
+++ 2.16/gas/testsuite/gas/ia64/reloc-uw.s	2005-05-18 14:50:58.321411824 +0200
@@ -0,0 +1,13 @@
+	.text
+
+	.macro uw, type
+	.proc	uw\type
+	.\type	uw\type
+uw\type:
+	.unwentry
+	br.ret.sptk rp
+	.endp	uw\type
+	.endm
+
+	uw global
+	uw weak

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: PATCH: Don't allow ia64 unwind section to point to section in different files
@ 2005-05-19  8:26 Jan Beulich
  2005-05-19 15:18 ` Daniel Jacobowitz
  0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2005-05-19  8:26 UTC (permalink / raw)
  To: drow, wilson; +Cc: davidm, hjl, binutils

Since this fixes a problem with building the Linux kernel, should this also go into the 2.16 branch? Thanks, Jan

>>> James E Wilson <wilson@specifixinc.com> 18.05.05 21:14:55 >>>
On Wed, 2005-05-18 at 06:57, Jan Beulich wrote:
> 	* config/tc-ia64.c (dot_endp): Don't use global symbol for unwind
> 	relocations in unwind section.

OK.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com 



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2005-05-19 12:20 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CBDB88BFD06F7F408399DBCF8776B3DC0424E404@scsmsx403.amr.corp.intel.com>
     [not found] ` <17029.3906.33841.302589@napali.hpl.hp.com>
     [not found]   ` <20050513205004.GB30928@lucon.org>
     [not found]     ` <17029.5402.827349.738563@napali.hpl.hp.com>
     [not found]       ` <20050513210111.GB31069@lucon.org>
     [not found]         ` <17029.5812.552722.635968@napali.hpl.hp.com>
2005-05-13 21:58           ` PATCH: Don't allow ia64 unwind section to point to section in different files H. J. Lu
2005-05-14  0:28             ` H. J. Lu
2005-05-16 13:58               ` David Mosberger
2005-05-16 14:29                 ` H. J. Lu
2005-05-17 20:52             ` James E Wilson
2005-05-17 21:28               ` David Mosberger
2005-05-17 22:56               ` H. J. Lu
2005-05-18  0:15                 ` James E Wilson
2005-05-18  0:15                   ` H. J. Lu
2005-05-18  7:02 Jan Beulich
2005-05-18 13:58 ` H. J. Lu
2005-05-18  7:23 Jan Beulich
     [not found] <s28af68c.020@emea1-mh.id2.novell.com>
2005-05-18  8:06 ` David Mosberger
2005-05-18 15:16 Jan Beulich
2005-05-18 15:21 ` H. J. Lu
2005-05-18 15:26   ` David Mosberger
2005-05-18 15:33     ` H. J. Lu
2005-05-18 16:27       ` David Mosberger
2005-05-18 19:35 ` James E Wilson
2005-05-19  8:26 Jan Beulich
2005-05-19 15:18 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).