public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H. J. Lu" <hjl@lucon.org>
To: Jim Wilson <wilson@tuliptree.org>
Cc: binutils@sources.redhat.com
Subject: Re: RFA: Please comment on this ia64 patch
Date: Sat, 03 May 2003 16:05:00 -0000	[thread overview]
Message-ID: <20030503090500.A4269@lucon.org> (raw)
In-Reply-To: <3EB2D89E.6020803@tuliptree.org>; from wilson@tuliptree.org on Fri, May 02, 2003 at 04:44:14PM -0400

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

On Fri, May 02, 2003 at 04:44:14PM -0400, Jim Wilson wrote:
> H. J. Lu wrote:
> > I added the support for 'o' and "unwind" in section directive for ia64
> > in this patch
> 
> The part I can't answer is the question about having a generic letter 
> that maps to SEC_LINK_ORDER.  Someone else would have to comment on 
> that.  I suspect it wouldn't be very useful at this time because 
> GNU/Linux doesn't actively use SEC_LINK_ORDER.
> 
> I noticed you didn't put 'o' into the IA-64 error message.  If we are 
> accepting 'o', we should document it in the error message.
> 
> I noticed you don't set the SHF_LINK_ORDER when seeing the 'o'.  This 
> does do something useful, though maybe not for GNU/Linux system.  I know 
> that the IA-64 ABI and HPUX require that it be set.  This has come up 
> before.  Note that bfd/elfxx-ia64.c tries to set SHF_LINK_ORDER and 
> SHT_IA_64_UNWIND for unwind section.  So I think your patch should 
> return SHF_LINK_ORDER for 'o' to be consistent.  See also the code in 
> elfNN_ia64_final_write_processing that sets the sh_link and sh_info 
> fields which is supposed to make SHF_LINK_ORDER useful.
> 
> Otherwise the patch looks fine.  The non-IA-64 parts look like obvious 
> bug fixes, so I'll approve the entire patch with the two suggestions I 
> made above.
> 

Thanks. This is the patch I checked in.


H.J.

[-- Attachment #2: gas-ia64-unwind.patch --]
[-- Type: text/plain, Size: 5015 bytes --]

gas/

2003-05-03  H.J. Lu <hjl@gnu.org>

	* config/obj-elf.c (obj_elf_parse_section_letters): Make it a
	fatal error for unknown section attribute.

	* config/tc-alpha.c (alpha_elf_section_letter): Return -1 for
	unknown section attribute.
	* config/tc-ia64.c (ia64_elf_section_letter): Likewise.
	* config/tc-ppc.c (ppc_section_letter): Likewise.

	* config/tc-ia64.c (ia64_elf_section_letter): Handle 'o'.
	(ia64_elf_section_type): Accept "unwind".

gas/testsuite/

2003-05-03  H.J. Lu <hjl@gnu.org>

	* gas/ia64/ia64.exp: Add unwind.

	* gas/ia64/unwind.s: New. Test the new section attribute 'o'
	and the new section type "unwind".
	* gas/ia64/unwind.d: Likewise.

--- gas/config/obj-elf.c.unwind	2003-05-03 08:51:47.000000000 -0700
+++ gas/config/obj-elf.c	2003-05-03 08:51:54.000000000 -0700
@@ -845,10 +845,7 @@ obj_elf_parse_section_letters (str, len)
 	      attr |= md_attr;
 	    else
 #endif
-	      {
-		as_warn ("%s", bad_msg);
-		attr = -1;
-	      }
+	      as_fatal ("%s", bad_msg);
 	  }
 	  break;
 	}
--- gas/config/tc-alpha.c.unwind	2003-05-03 08:51:47.000000000 -0700
+++ gas/config/tc-alpha.c	2003-05-03 08:51:54.000000000 -0700
@@ -5635,7 +5635,7 @@ alpha_elf_section_letter (letter, ptr_ms
     return SHF_ALPHA_GPREL;
 
   *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S,G,T in string");
-  return 0;
+  return -1;
 }
 
 /* Map SHF_ALPHA_GPREL to SEC_SMALL_DATA.  */
--- gas/config/tc-ia64.c.unwind	2003-05-03 08:51:47.000000000 -0700
+++ gas/config/tc-ia64.c	2003-05-03 08:56:20.000000000 -0700
@@ -968,9 +968,11 @@ ia64_elf_section_letter (letter, ptr_msg
 {
   if (letter == 's')
     return SHF_IA_64_SHORT;
+  else if (letter == 'o')
+    return SHF_LINK_ORDER;
 
-  *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S,G,T in string");
-  return 0;
+  *ptr_msg = _("Bad .section directive: want a,o,s,w,x,M,S,G,T in string");
+  return -1;
 }
 
 /* Map SHF_IA_64_SHORT to SEC_SMALL_DATA.  */
@@ -1004,6 +1006,9 @@ ia64_elf_section_type (str, len)
   if (STREQ (ELF_STRING_ia64_unwind_once))
     return SHT_IA_64_UNWIND;
 
+  if (STREQ ("unwind"))
+    return SHT_IA_64_UNWIND;
+
   if (STREQ ("init_array"))
     return SHT_INIT_ARRAY;
 
--- gas/config/tc-ppc.c.unwind	2003-05-03 08:51:47.000000000 -0700
+++ gas/config/tc-ppc.c	2003-05-03 08:51:54.000000000 -0700
@@ -2754,7 +2754,7 @@ ppc_section_letter (letter, ptr_msg)
     return SHF_EXCLUDE;
 
   *ptr_msg = _("Bad .section directive: want a,e,w,x,M,S,G,T in string");
-  return 0;
+  return -1;
 }
 
 int
--- gas/testsuite/gas/ia64/ia64.exp.unwind	2003-05-03 08:51:47.000000000 -0700
+++ gas/testsuite/gas/ia64/ia64.exp	2003-05-03 08:52:29.000000000 -0700
@@ -47,4 +47,5 @@ if [istarget "ia64-*"] then {
     run_dump_test "order"
     run_dump_test "global"
     run_dump_test "secname"
+    run_dump_test "unwind"
 }
--- gas/testsuite/gas/ia64/unwind.d.unwind	2003-05-03 08:51:54.000000000 -0700
+++ gas/testsuite/gas/ia64/unwind.d	2003-05-03 08:51:54.000000000 -0700
@@ -0,0 +1,30 @@
+#readelf: -S
+#name: ia64 unwind section
+
+There are 9 section headers, starting at offset 0xa0:
+
+Section Headers:
+  \[Nr\] Name              Type             Address           Offset
+       Size              EntSize          Flags  Link  Info  Align
+  \[ 0\]                   NULL             0000000000000000  00000000
+       0000000000000000  0000000000000000           0     0     0
+  \[ 1\] \.text             PROGBITS         0000000000000000  00000040
+       0000000000000000  0000000000000000  AX       0     0     16
+  \[ 2\] \.data             PROGBITS         0000000000000000  00000040
+       0000000000000000  0000000000000000  WA       0     0     1
+  \[ 3\] \.bss              NOBITS           0000000000000000  00000040
+       0000000000000000  0000000000000000  WA       0     0     1
+  \[ 4\] \.IA_64\.unwind_inf PROGBITS         0000000000000000  00000040
+       0000000000000008  0000000000000000   A       0     0     8
+  \[ 5\] \.IA_64\.unwind     IA_64_UNWIND     0000000000000000  00000048
+       0000000000000008  0000000000000000  AL       1     1     8
+  \[ 6\] \.shstrtab         STRTAB           0000000000000000  00000050
+       000000000000004d  0000000000000000           0     0     1
+  \[ 7\] \.symtab           SYMTAB           0000000000000000  000002e0
+       0000000000000090  0000000000000018           8     6     8
+  \[ 8\] \.strtab           STRTAB           0000000000000000  00000370
+       0000000000000001  0000000000000000           0     0     1
+Key to Flags:
+  W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
+  I \(info\), L \(link order\), G \(group\), x \(unknown\)
+  O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
--- gas/testsuite/gas/ia64/unwind.s.unwind	2003-05-03 08:51:54.000000000 -0700
+++ gas/testsuite/gas/ia64/unwind.s	2003-05-03 08:51:54.000000000 -0700
@@ -0,0 +1,4 @@
+	.section .IA_64.unwind_info, "a", "progbits"
+	data8 1234
+	.section .IA_64.unwind, "ao", "unwind"
+	data8 1234

      reply	other threads:[~2003-05-03 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-02 15:30 H. J. Lu
2003-05-02 23:43 ` Jim Wilson
2003-05-03 16:05   ` H. J. Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030503090500.A4269@lucon.org \
    --to=hjl@lucon.org \
    --cc=binutils@sources.redhat.com \
    --cc=wilson@tuliptree.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).