public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* i386 ld --gc-sections and few minor problems with objdump --disassemble-all -m i8086
@ 2001-07-18  2:50 Etienne Lorrain
  2001-07-18  6:32 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Etienne Lorrain @ 2001-07-18  2:50 UTC (permalink / raw)
  To: binutils

  Hello,

  I had a problem quite a long time ago on my "gujin" bootloader with
 "ld --gc-sections", the process was not removing unused sections.
 I finaly found that when using "ld --oformat=binary", the garbage
 collection is not done. It is perfectly working when generating
 an intermediate ELF file and using objcopy to get the binary file.
  Maybe someone could add a warning in this case, but the main thing
 is to have that written somewhere: done.

  The next subjects are few small bugs / improvement:
  - In the ld script file, it does not seems to be possible to
  exclude a library like:
    *(EXCLUDE_FILE(libext2fs.a) .text*)
  you have to write all the object files the library contains.

  - I did not understand how to use STARTUP(file):
   Inside SECTIONS {} it generates a syntax error
   Outside SECTIONS {} it generates double definition errors
   when you describe in which section to load .text and .data
   of this file.

  - In "objdump --disassemble-all -m i8086", the opcodes
    "F3 AA" is translated "repz stos" instead of "rep stos"

  - the opcode "67 66 0F 01 54 24 14" is displayed
        addr32
        data32
        lgdt  36(%si)
        ... last byte mixed with next instruction ...

    instead of:
        data32 lgdt 36(%esi)
      or
        lgdtl 36(%esi)

  - there is no need to display addr32 when it is easy to
    see from the addressing mode:
    addr32 pushl 0x30(%ebx)
      can be just displayed:
    pushl 0x30(%ebx)

  Thanks for reading,
  Etienne.

___________________________________________________________
Do You Yahoo!? -- Vos albums photos en ligne, 
Yahoo! Photos : http://fr.photos.yahoo.com

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

* Re: i386 ld --gc-sections and few minor problems with objdump --disassemble-all -m i8086
  2001-07-18  2:50 i386 ld --gc-sections and few minor problems with objdump --disassemble-all -m i8086 Etienne Lorrain
@ 2001-07-18  6:32 ` Alan Modra
  2001-07-23  0:43   ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2001-07-18  6:32 UTC (permalink / raw)
  To: Etienne Lorrain; +Cc: binutils

Replying to the "minor bug" part..

On Wed, Jul 18, 2001 at 11:48:58AM +0200, Etienne Lorrain wrote:
> 
>   - In "objdump --disassemble-all -m i8086", the opcodes
>     "F3 AA" is translated "repz stos" instead of "rep stos"

Well, yes.  "rep" is an alias for "repz" and the assembler does accept
"repz stosb", so I don't see this as a big problem.  If someone wants to
provide a patch, that would be OK too.

>   - the opcode "67 66 0F 01 54 24 14" is displayed
>         addr32
>         data32
>         lgdt  36(%si)
>         ... last byte mixed with next instruction ...

This one I'm fixing.

>   - there is no need to display addr32 when it is easy to
>     see from the addressing mode:
>     addr32 pushl 0x30(%ebx)
>       can be just displayed:
>     pushl 0x30(%ebx)

True, but it's more than a few minutes work to fix.

opcodes/ChangeLog
	* i386-dis.c (grps): Print l or w suffix, and require mem modrm
	for lgdt, lidt, sgdt, sidt.

-- 
Alan Modra

Index: opcodes/i386-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/i386-dis.c,v
retrieving revision 1.27
diff -u -p -r1.27 i386-dis.c
--- i386-dis.c	2001/07/09 14:22:11	1.27
+++ i386-dis.c	2001/07/18 12:43:57
@@ -197,7 +197,7 @@ fetch_data (info, addr)
 #define indirEv OP_indirE, v_mode
 #define Ew OP_E, w_mode
 #define Ma OP_E, v_mode
-#define M OP_E, 0		/* lea */
+#define M OP_E, 0		/* lea, lgdt, etc. */
 #define Mp OP_E, 0		/* 32 or 48 bit memory operand for LDS, LES etc */
 #define Gb OP_G, b_mode
 #define Gv OP_G, v_mode
@@ -1315,14 +1315,14 @@ static const struct dis386 grps[][8] = {
   },
   /* GRP7 */
   {
-    { "sgdt", Ew, XX, XX },
-    { "sidt", Ew, XX, XX },
-    { "lgdt", Ew, XX, XX },
-    { "lidt", Ew, XX, XX },
-    { "smsw", Ew, XX, XX },
-    { "(bad)", XX, XX, XX },
-    { "lmsw", Ew, XX, XX },
-    { "invlpg", Ew, XX, XX },
+    { "sgdtQ",	 M, XX, XX },
+    { "sidtQ",	 M, XX, XX },
+    { "lgdtQ",	 M, XX, XX },
+    { "lidtQ",	 M, XX, XX },
+    { "smsw",	Ew, XX, XX },
+    { "(bad)",	XX, XX, XX },
+    { "lmsw",	Ew, XX, XX },
+    { "invlpg",	Ew, XX, XX },
   },
   /* GRP8 */
   {

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

* Re: i386 ld --gc-sections and few minor problems with objdump --disassemble-all -m i8086
  2001-07-18  6:32 ` Alan Modra
@ 2001-07-23  0:43   ` Alan Modra
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2001-07-23  0:43 UTC (permalink / raw)
  To: binutils

On Wed, Jul 18, 2001 at 11:01:58PM +0930, Alan Modra wrote:
> opcodes/ChangeLog
> 	* i386-dis.c (grps): Print l or w suffix, and require mem modrm
> 	for lgdt, lidt, sgdt, sidt.

Oops, forgot to commit this, which goes with the above.

gas/testsuite/ChangeLog
	* gas/i386/opcode.d: Tweak lgdt for 2001-07-18 change.
	* gas/i386/intel.d: Likewise.

-- 
Alan Modra

Index: gas/testsuite/gas/i386/intel.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/intel.d,v
retrieving revision 1.9
diff -u -p -r1.9 intel.d
--- intel.d	2001/03/18 21:28:56	1.9
+++ intel.d	2001/07/18 21:45:20
@@ -248,7 +248,7 @@ Disassembly of section .text:
  304:	fd [ 	]*std    
  305:	ff 90 90 90 90 90 [ 	]*call   \*0x90909090\(%eax\)
  30b:	0f 00 90 90 90 90 90 [ 	]*lldt   0x90909090\(%eax\)
- 312:	0f 01 90 90 90 90 90 [ 	]*lgdt   0x90909090\(%eax\)
+ 312:	0f 01 90 90 90 90 90 [ 	]*lgdtl  0x90909090\(%eax\)
  319:	0f 02 90 90 90 90 90 [ 	]*lar    0x90909090\(%eax\),%edx
  320:	0f 03 90 90 90 90 90 [ 	]*lsl    0x90909090\(%eax\),%edx
  327:	0f 06 [ 	]*clts   
Index: gas/testsuite/gas/i386/opcode.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/i386/opcode.d,v
retrieving revision 1.2
diff -u -p -r1.2 opcode.d
--- opcode.d	1999/05/13 06:00:21	1.2
+++ opcode.d	2001/07/18 21:45:28
@@ -248,7 +248,7 @@ Disassembly of section .text:
  304:	fd [ 	]*std    
  305:	ff 90 90 90 90 90 [ 	]*call   \*0x90909090\(%eax\)
  30b:	0f 00 90 90 90 90 90 [ 	]*lldt   0x90909090\(%eax\)
- 312:	0f 01 90 90 90 90 90 [ 	]*lgdt   0x90909090\(%eax\)
+ 312:	0f 01 90 90 90 90 90 [ 	]*lgdtl  0x90909090\(%eax\)
  319:	0f 02 90 90 90 90 90 [ 	]*lar    0x90909090\(%eax\),%edx
  320:	0f 03 90 90 90 90 90 [ 	]*lsl    0x90909090\(%eax\),%edx
  327:	0f 06 [ 	]*clts   

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

end of thread, other threads:[~2001-07-23  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-18  2:50 i386 ld --gc-sections and few minor problems with objdump --disassemble-all -m i8086 Etienne Lorrain
2001-07-18  6:32 ` Alan Modra
2001-07-23  0:43   ` Alan Modra

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