public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] mips: Print extra elf header flags.
@ 2007-02-16 16:19 Carlos O'Donell
  2007-02-16 16:19 ` Thiemo Seufer
  2007-02-16 22:56 ` Hans-Peter Nilsson
  0 siblings, 2 replies; 12+ messages in thread
From: Carlos O'Donell @ 2007-02-16 16:19 UTC (permalink / raw)
  To: Nick Clifton, binutils; +Cc: Richard Sandiford


The following patch adds support for printing all extra MIPS elf
header flags.

Previous behaviour:
objdump -p foo.o
private flags = 50001007: [abi=O32] [mips32] [not 32bitmode]

With the patch:
private flags = 50001007: [abi=O32] [mips32] [not 32bitmode]\
[.noreorder] [PIC] [CPIC]

No regressions on mips-linux-gnu. 

OK to apply?

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

bfd/

2007-02-16  Carlos O'Donell  <carlos@codesourcery.com>

	* elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data):
	Print EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_XGOT
	and EF_MIPS_UCODE.

Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.193
diff -u -p -r1.193 elfxx-mips.c
--- bfd/elfxx-mips.c	29 Jan 2007 16:29:21 -0000	1.193
+++ bfd/elfxx-mips.c	16 Feb 2007 14:54:33 -0000
@@ -11223,6 +11223,21 @@ _bfd_mips_elf_print_private_bfd_data (bf
   else
     fprintf (file, _(" [not 32bitmode]"));
 
+  if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
+    fprintf (file, _(" [.noreorder]"));
+
+  if (elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
+    fprintf (file, _(" [PIC]"));
+
+  if (elf_elfheader (abfd)->e_flags & EF_MIPS_CPIC)
+    fprintf (file, _(" [CPIC]"));
+
+  if (elf_elfheader (abfd)->e_flags & EF_MIPS_XGOT)
+    fprintf (file, _(" [XGOT]"));
+
+  if (elf_elfheader (abfd)->e_flags & EF_MIPS_UCODE)
+    fprintf (file, _(" [UCODE]"));
+
   fputc ('\n', file);
 
   return TRUE;

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-16 16:19 [PATCH] mips: Print extra elf header flags Carlos O'Donell
@ 2007-02-16 16:19 ` Thiemo Seufer
  2007-02-16 22:24   ` Carlos O'Donell
  2007-02-16 22:56 ` Hans-Peter Nilsson
  1 sibling, 1 reply; 12+ messages in thread
From: Thiemo Seufer @ 2007-02-16 16:19 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Nick Clifton, binutils, Richard Sandiford

Carlos O'Donell wrote:
> 
> The following patch adds support for printing all extra MIPS elf
> header flags.
> 
> Previous behaviour:
> objdump -p foo.o
> private flags = 50001007: [abi=O32] [mips32] [not 32bitmode]
> 
> With the patch:
> private flags = 50001007: [abi=O32] [mips32] [not 32bitmode]\
> [.noreorder] [PIC] [CPIC]

Please drop the the leading dot for noreorder. Ok with that change.


Thiemo

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-16 16:19 ` Thiemo Seufer
@ 2007-02-16 22:24   ` Carlos O'Donell
  0 siblings, 0 replies; 12+ messages in thread
From: Carlos O'Donell @ 2007-02-16 22:24 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: Nick Clifton, binutils, Richard Sandiford

On Fri, Feb 16, 2007 at 04:10:46PM +0000, Thiemo Seufer wrote:
> Carlos O'Donell wrote:
> > 
> > The following patch adds support for printing all extra MIPS elf
> > header flags.
> > 
> > Previous behaviour:
> > objdump -p foo.o
> > private flags = 50001007: [abi=O32] [mips32] [not 32bitmode]
> > 
> > With the patch:
> > private flags = 50001007: [abi=O32] [mips32] [not 32bitmode]\
> > [.noreorder] [PIC] [CPIC]
> 
> Please drop the the leading dot for noreorder. Ok with that change.

Thiemo,

Leading dot dropped for noreorder. Thanks for the review. Committed.

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-16 16:19 [PATCH] mips: Print extra elf header flags Carlos O'Donell
  2007-02-16 16:19 ` Thiemo Seufer
@ 2007-02-16 22:56 ` Hans-Peter Nilsson
  2007-02-16 23:38   ` Carlos O'Donell
  1 sibling, 1 reply; 12+ messages in thread
From: Hans-Peter Nilsson @ 2007-02-16 22:56 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Nick Clifton, binutils, Richard Sandiford

On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> +  if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
> +    fprintf (file, _(" [.noreorder]"));

I suggest you drop the _() on all these or else the translation
team may be tempted to translate these strings to every
(supported) human language.  ;-)

brgds, H-P

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-16 22:56 ` Hans-Peter Nilsson
@ 2007-02-16 23:38   ` Carlos O'Donell
  2007-02-17  0:23     ` Hans-Peter Nilsson
  0 siblings, 1 reply; 12+ messages in thread
From: Carlos O'Donell @ 2007-02-16 23:38 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: Nick Clifton, binutils, Richard Sandiford

On Fri, Feb 16, 2007 at 05:24:34PM -0500, Hans-Peter Nilsson wrote:
> On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > +  if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
> > +    fprintf (file, _(" [.noreorder]"));
> 
> I suggest you drop the _() on all these or else the translation
> team may be tempted to translate these strings to every
> (supported) human language.  ;-)

I was blindly following the function convention, which uses _() for all
the output flags.

Is it a bad thing to mark all strings with _()? It's certainly an easier
rule than "Use your discretion" :-)

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-16 23:38   ` Carlos O'Donell
@ 2007-02-17  0:23     ` Hans-Peter Nilsson
  2007-02-19  6:45       ` Carlos O'Donell
  0 siblings, 1 reply; 12+ messages in thread
From: Hans-Peter Nilsson @ 2007-02-17  0:23 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: binutils

On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > > +  if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
> > > +    fprintf (file, _(" [.noreorder]"));

> Is it a bad thing to mark all strings with _()? It's certainly an easier
> rule than "Use your discretion" :-)

The rule of thumb is "does it make sense to have this text
output in another human language".  E.g. "[ej omstuvad]" for the
above in Swedish (not an official translation).

brgds, H-P

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-17  0:23     ` Hans-Peter Nilsson
@ 2007-02-19  6:45       ` Carlos O'Donell
  2007-02-19 11:46         ` Andreas Schwab
  2007-02-19 14:29         ` Hans-Peter Nilsson
  0 siblings, 2 replies; 12+ messages in thread
From: Carlos O'Donell @ 2007-02-19  6:45 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils

On Fri, Feb 16, 2007 at 06:36:32PM -0500, Hans-Peter Nilsson wrote:
> On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > > On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > > > +  if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
> > > > +    fprintf (file, _(" [.noreorder]"));
> 
> > Is it a bad thing to mark all strings with _()? It's certainly an easier
> > rule than "Use your discretion" :-)
> 
> The rule of thumb is "does it make sense to have this text
> output in another human language".  E.g. "[ej omstuvad]" for the
> above in Swedish (not an official translation).

You avoided the question. Is it a bad thing to mark all strings with
_()? Personally I would rather have all strings marked for translation.

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-19  6:45       ` Carlos O'Donell
@ 2007-02-19 11:46         ` Andreas Schwab
  2007-02-19 13:02           ` Thiemo Seufer
  2007-02-19 14:29         ` Hans-Peter Nilsson
  1 sibling, 1 reply; 12+ messages in thread
From: Andreas Schwab @ 2007-02-19 11:46 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Hans-Peter Nilsson, binutils

Carlos O'Donell <carlos@codesourcery.com> writes:

> You avoided the question. Is it a bad thing to mark all strings with
> _()? Personally I would rather have all strings marked for translation.

It does not make any sense to mark a string for translation when it must
not be translated.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-19 11:46         ` Andreas Schwab
@ 2007-02-19 13:02           ` Thiemo Seufer
  2007-02-20 13:41             ` Thiemo Seufer
  0 siblings, 1 reply; 12+ messages in thread
From: Thiemo Seufer @ 2007-02-19 13:02 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Carlos O'Donell, Hans-Peter Nilsson, binutils

Andreas Schwab wrote:
> Carlos O'Donell <carlos@codesourcery.com> writes:
> 
> > You avoided the question. Is it a bad thing to mark all strings with
> > _()? Personally I would rather have all strings marked for translation.
> 
> It does not make any sense to mark a string for translation when it must
> not be translated.

Does the appended patch look ok to you?


Thiemo


2007-02-19  Thiemo Seufer  <ths@mips.com>

	* elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Remove
	translation marker from untranslatable strings.


Index: elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.194
diff -u -p -r1.194 elfxx-mips.c
--- elfxx-mips.c	16 Feb 2007 17:48:12 -0000	1.194
+++ elfxx-mips.c	19 Feb 2007 11:40:01 -0000
@@ -11192,51 +11192,51 @@ _bfd_mips_elf_print_private_bfd_data (bf
     fprintf (file, _(" [no abi set]"));
 
   if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1)
-    fprintf (file, _(" [mips1]"));
+    fprintf (file, " [mips1]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2)
-    fprintf (file, _(" [mips2]"));
+    fprintf (file, " [mips2]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3)
-    fprintf (file, _(" [mips3]"));
+    fprintf (file, " [mips3]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4)
-    fprintf (file, _(" [mips4]"));
+    fprintf (file, " [mips4]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5)
-    fprintf (file, _(" [mips5]"));
+    fprintf (file, " [mips5]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32)
-    fprintf (file, _(" [mips32]"));
+    fprintf (file, " [mips32]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64)
-    fprintf (file, _(" [mips64]"));
+    fprintf (file, " [mips64]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2)
-    fprintf (file, _(" [mips32r2]"));
+    fprintf (file, " [mips32r2]");
   else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R2)
-    fprintf (file, _(" [mips64r2]"));
+    fprintf (file, " [mips64r2]");
   else
     fprintf (file, _(" [unknown ISA]"));
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_MDMX)
-    fprintf (file, _(" [mdmx]"));
+    fprintf (file, " [mdmx]");
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH_ASE_M16)
-    fprintf (file, _(" [mips16]"));
+    fprintf (file, " [mips16]");
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_32BITMODE)
-    fprintf (file, _(" [32bitmode]"));
+    fprintf (file, " [32bitmode]");
   else
     fprintf (file, _(" [not 32bitmode]"));
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
-    fprintf (file, _(" [noreorder]"));
+    fprintf (file, " [noreorder]");
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_PIC)
-    fprintf (file, _(" [PIC]"));
+    fprintf (file, " [PIC]");
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_CPIC)
-    fprintf (file, _(" [CPIC]"));
+    fprintf (file, " [CPIC]");
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_XGOT)
-    fprintf (file, _(" [XGOT]"));
+    fprintf (file, " [XGOT]");
 
   if (elf_elfheader (abfd)->e_flags & EF_MIPS_UCODE)
-    fprintf (file, _(" [UCODE]"));
+    fprintf (file, " [UCODE]");
 
   fputc ('\n', file);
 

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-19  6:45       ` Carlos O'Donell
  2007-02-19 11:46         ` Andreas Schwab
@ 2007-02-19 14:29         ` Hans-Peter Nilsson
  2007-02-19 17:03           ` Carlos O'Donell
  1 sibling, 1 reply; 12+ messages in thread
From: Hans-Peter Nilsson @ 2007-02-19 14:29 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: binutils

On Sun, 18 Feb 2007, Carlos O'Donell wrote:
> On Fri, Feb 16, 2007 at 06:36:32PM -0500, Hans-Peter Nilsson wrote:
> > On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > > > On Fri, 16 Feb 2007, Carlos O'Donell wrote:
> > > > > +  if (elf_elfheader (abfd)->e_flags & EF_MIPS_NOREORDER)
> > > > > +    fprintf (file, _(" [.noreorder]"));
> >
> > > Is it a bad thing to mark all strings with _()? It's certainly an easier
> > > rule than "Use your discretion" :-)
> >
> > The rule of thumb is "does it make sense to have this text
> > output in another human language".  E.g. "[ej omstuvad]" for the
> > above in Swedish (not an official translation).
>
> You avoided the question.

No I didn't; it seemed you didn't understand my reply so I
offered a longer explanation, which implied "bad: yes".  If you
don't know it at this time, I suggest you take a brief look into
what actually happens with _() and the other i18n mechanisms.
(It's one of those "oh, icky issue, but I guess that's the best
way to do it without obfuscating the code too much" moments.)

> Is it a bad thing to mark all strings with
> _()?

Yes.  You must understand what it means.

> Personally I would rather have all strings marked for
> translation.

Again, I suggest not, because sometimes there is the possibility
that the translator *will* translate something that *shouldn't*
be translated, e.g. "load" as a mnemonic and in the example
above, I think "noreorder" shouldn't be translated.  (Not that
I'm sure it's proper English in the first place.)

brgds, H-P

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-19 14:29         ` Hans-Peter Nilsson
@ 2007-02-19 17:03           ` Carlos O'Donell
  0 siblings, 0 replies; 12+ messages in thread
From: Carlos O'Donell @ 2007-02-19 17:03 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: binutils

On Mon, Feb 19, 2007 at 08:09:20AM -0500, Hans-Peter Nilsson wrote:
> > You avoided the question.
> 
> No I didn't; it seemed you didn't understand my reply so I
> offered a longer explanation, which implied "bad: yes".  If you
> don't know it at this time, I suggest you take a brief look into
> what actually happens with _() and the other i18n mechanisms.
> (It's one of those "oh, icky issue, but I guess that's the best
> way to do it without obfuscating the code too much" moments.)

Beware of implied meanings. I was looking for a straight answers.
 
> > Is it a bad thing to mark all strings with
> > _()?
> 
> Yes.  You must understand what it means.

I do, and I have knowledge of the mechanisms, maybe not complete
understanding.  I didn't forsee the failure case you mention below.

> > Personally I would rather have all strings marked for
> > translation.
> 
> Again, I suggest not, because sometimes there is the possibility
> that the translator *will* translate something that *shouldn't*
> be translated, e.g. "load" as a mnemonic and in the example
> above, I think "noreorder" shouldn't be translated.  (Not that
> I'm sure it's proper English in the first place.)

I see the problem now. I also see Theimo has posted a patch to remove
all the translations from that function. Thanks for taking to educate me
on the issue.

Many thanks!

Cheers,
Carlos.
-- 
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716

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

* Re: [PATCH] mips: Print extra elf header flags.
  2007-02-19 13:02           ` Thiemo Seufer
@ 2007-02-20 13:41             ` Thiemo Seufer
  0 siblings, 0 replies; 12+ messages in thread
From: Thiemo Seufer @ 2007-02-20 13:41 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Carlos O'Donell, Hans-Peter Nilsson, binutils

Thiemo Seufer wrote:
> Andreas Schwab wrote:
> > Carlos O'Donell <carlos@codesourcery.com> writes:
> > 
> > > You avoided the question. Is it a bad thing to mark all strings with
> > > _()? Personally I would rather have all strings marked for translation.
> > 
> > It does not make any sense to mark a string for translation when it must
> > not be translated.
> 
> Does the appended patch look ok to you?
> 
> 
> Thiemo
> 
> 
> 2007-02-19  Thiemo Seufer  <ths@mips.com>
> 
> 	* elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): Remove
> 	translation marker from untranslatable strings.

Committed.


Thiemo

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

end of thread, other threads:[~2007-02-20 12:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16 16:19 [PATCH] mips: Print extra elf header flags Carlos O'Donell
2007-02-16 16:19 ` Thiemo Seufer
2007-02-16 22:24   ` Carlos O'Donell
2007-02-16 22:56 ` Hans-Peter Nilsson
2007-02-16 23:38   ` Carlos O'Donell
2007-02-17  0:23     ` Hans-Peter Nilsson
2007-02-19  6:45       ` Carlos O'Donell
2007-02-19 11:46         ` Andreas Schwab
2007-02-19 13:02           ` Thiemo Seufer
2007-02-20 13:41             ` Thiemo Seufer
2007-02-19 14:29         ` Hans-Peter Nilsson
2007-02-19 17:03           ` Carlos O'Donell

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).