Debian Bug report logs - #541535
amd64+i386 as: i8086 Intel syntax far jumps broken (both variants of them)

version graph

Package: binutils; Maintainer for binutils is Matthias Klose <doko@debian.org>; Source for binutils is src:binutils.

Reported by: Thorsten Glaser <tg@mirbsd.de>

Date: Fri, 14 Aug 2009 17:27:01 UTC

Severity: normal

Tags: fixed-in-experimental

Found in versions binutils/2.20-4, binutils/2.19.91.20090927-1, binutils/2.19.51.20090805-1

Fixed in versions binutils/2.18.1~cvs20080103-7, binutils/2.20.51.20100101-1, binutils/2.20-5

Done: Matthias Klose <doko@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://sourceware.org/bugzilla/show_bug.cgi?id=10740

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, tg@mirbsd.de, mika@grml.org, ., Matthias Klose <doko@debian.org>:
Bug#541535; Package binutils. (Fri, 14 Aug 2009 17:27:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
New Bug report received and forwarded. Copy sent to tg@mirbsd.de, mika@grml.org, ., Matthias Klose <doko@debian.org>. (Fri, 14 Aug 2009 17:27:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: amd64+i386 as: i8086 Intel syntax far jumps broken (both variants of them)
Date: Fri, 14 Aug 2009 17:23:57 +0000
Package: binutils
Version: 2.19.51.20090805-1
Severity: normal

First of, a totally reduced minimal testcase. Let's try it on MirBSD:

tg@herc:~ $ cat >testmin.s
	.intel_syntax noprefix
	.text
	.code16
	.globl	_start
_start:	ljmp	0xF000,0xFFF0
tg@herc:~ $ cc -nostdlib -Wl,--oformat,binary -Wl,-Ttext,0 testmin.s
tg@herc:~ $ hd a.out
00000000  EA F0 FF 00 F0          -                          |.....|
tg@herc:~ $ as -V
GNU assembler version 050707 () using BFD version 050707 20050707

This is an i386 native GNU as, targetting (here) i8086 (due to the .code16
pseudo-op) and using Intel syntax, as opposed to that cruel AT&T syntax,
which thankfully has been supported by about every i386 gas from 1999 and
later.

It fails on Debian sid though (both amd64 and i386, I only have an i386
sid schroot though):

tg@frozenfish:~ $ as testmin.s
testmin.s: Assembler messages:
testmin.s:5: Error: too many memory references for jmp'
1|tg@frozenfish:~ $ as -V
GNU assembler version 2.19.51 (i486-linux-gnu) using BFD version (GNU Binutils for Debian) 2.19.51.20090805

Oh how great. Let's try the i386 lenny schroot.

tg@frozenfish:~ $ as testmin.s
tg@frozenfish:~ $ file a.out
a.out: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
tg@frozenfish:~ $ objdump -d -Mintel,i8086 a.out

a.out:     file format elf32-i386

Disassembly of section .text:

00000000 <_start>:
   0:   ea f0 ff 00 f0          jmp    0xf000:0xfff0
tg@frozenfish:~ $ as -V
GNU assembler version 2.18.0 (i486-linux-gnu) using BFD version (GNU Binutils for Debian) 2.18.0.20080103

Cool, it works there... (objdump on BSD shows s/:/,/ otherwise the same)

Now I install binutils-doc and "info as", then I read that the syntax for
far jumps has changed. Ye gods, how am I supposed to distinguish between
these when I target gas' intel syntax? But other than that issue, which
is VERY annoying and should be reverted upstream (i.e. the "older" syntax
should still be accepted), it simply doesn't work!

   * Immediate form long jumps and calls are call/ljmp $SECTION,
     $OFFSET' in AT&T syntax; the Intel syntax is all/jmp far
     SECTION:OFFSET'.  Also, the far return instruction is ret
     $STACK-ADJUST' in AT&T syntax; Intel syntax is et far
     STACK-ADJUST'.

(Intersting side note, the older syntax matched AT&T more closely; this
seems to be a try to get it more close to other Intel syntax assemblers,
which per se isn't a bad thing - or would have been in 1999. Now it's too
late... especially since more recent binutils are GPLv3.)

tg@frozenfish:~ $ cat testmin2.s
        .intel_syntax noprefix
        .text
        .code16
        .globl  _start
_start: jmp far 0xF000:0xFFF0
tg@frozenfish:~ $ as testmin2.s
testmin2.s: Assembler messages:
testmin2.s:5: Error: junk F000:0xFFF0' after expression

So there isn't even a way to do a JMP FAR here. (Apologies if my editor
stripped U+0060 while pasting, it's a command character and shouldn't
be used in any strings ever. Ask Markus Kuhn...)

I invoke the "I didn't do anything! (I didn't even do anything before!)"
because the aforementioned assembly source compiles fine using other ver-
sions of gas. I would like to get this fixed, as grml depends on it; it
may or may not be a bug you'd want to forward upstream.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-6-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
(would be mksh, but #540512 currently prevents that...)

Versions of packages binutils depends on:
ii  libc6                  2.9-24            GNU C Library: Shared libraries
ii  zlib1g                 1:1.2.3.3.dfsg-15 compression library - runtime

binutils recommends no packages.

Versions of packages binutils suggests:
ii  binutils-doc          2.19.51.20090805-1 Documentation for the GNU assemble

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#541535; Package binutils. (Tue, 29 Sep 2009 14:21:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Tue, 29 Sep 2009 14:21:09 GMT) Full text and rfc822 format available.

Message #10 received at 541535@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: control@bugs.debian.org
Cc: 541535@bugs.debian.org
Subject: as: i8086 Intel syntax far jumps broken
Date: Tue, 29 Sep 2009 14:05:53 +0000 (UTC)
found 541535 binutils/2.19.91.20090927-1
thanks

Still there…

//mirabilos
-- 
Yay for having to rewrite other people's Bash scripts because bash
suddenly stopped supporting the bash extensions they make use of
	-- Tonnerre Lombard in #nosec




Bug Marked as found in versions binutils/2.19.91.20090927-1. Request was from Thorsten Glaser <tg@mirbsd.de> to control@bugs.debian.org. (Tue, 29 Sep 2009 14:21:13 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'http://sourceware.org/bugzilla/show_bug.cgi?id=10740'. Request was from Thorsten Glaser <t.glaser@tarent.de> to control@bugs.debian.org. (Tue, 06 Oct 2009 14:21:03 GMT) Full text and rfc822 format available.

Bug Marked as fixed in versions binutils/2.18.1~cvs20080103-7. Request was from Thorsten Glaser <tg@mirbsd.de> to control@bugs.debian.org. (Sat, 10 Oct 2009 20:51:03 GMT) Full text and rfc822 format available.

Added tag(s) fixed-upstream. Request was from bts-link-upstream@lists.alioth.debian.org to control@bugs.debian.org. (Thu, 15 Oct 2009 19:48:33 GMT) Full text and rfc822 format available.

Bug Marked as found in versions binutils/2.20-4. Request was from Thorsten Glaser <tg@mirbsd.de> to control@bugs.debian.org. (Sun, 03 Jan 2010 16:24:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#541535; Package binutils. (Sun, 03 Jan 2010 16:33:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thorsten Glaser <tg@mirbsd.de>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sun, 03 Jan 2010 16:33:06 GMT) Full text and rfc822 format available.

Message #25 received at 541535@bugs.debian.org (full text, mbox):

From: Thorsten Glaser <tg@mirbsd.de>
To: 541535@bugs.debian.org
Cc: control@bugs.debian.org, Michael Prokop <mika@grml.org>
Subject: amd64+i386 as: i8086 Intel syntax far jumps broken ⇒ hmm, partially fixed
Date: Sun, 3 Jan 2010 16:30:00 +0000 (UTC)
fixed 541535 binutils/2.20.51.20100101-1
tags 541535 + fixed-in-experimental
thanks

$ as testmin2.s
testmin2.s: Assembler messages:
testmin2.s:5: Error: junk `0xF000:0xFFF0' after expression

But testmin.s (the original code) works now.

binutils-doc 2.20.51.20100101-1 says:
   * Immediate form long jumps and calls are `lcall/ljmp $SECTION,
     $OFFSET' in AT&T syntax; the Intel syntax is `call/jmp far
     SECTION:OFFSET'.  Also, the far return instruction is `lret
     $STACK-ADJUST' in AT&T syntax; Intel syntax is `ret far
     STACK-ADJUST'.

So this is now merely a documentation bug, in a different package,
and the original problem is indeed fixed in experimental.

bye,
//mirabilos
-- 
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font.	-- Rob Pike in "Notes on Programming in C"




Bug Marked as fixed in versions binutils/2.20.51.20100101-1. Request was from Thorsten Glaser <tg@mirbsd.de> to control@bugs.debian.org. (Sun, 03 Jan 2010 16:33:09 GMT) Full text and rfc822 format available.

Added tag(s) fixed-in-experimental. Request was from Thorsten Glaser <tg@mirbsd.de> to control@bugs.debian.org. (Sun, 03 Jan 2010 16:33:10 GMT) Full text and rfc822 format available.

Removed tag(s) fixed-upstream. Request was from bts-link-upstream@lists.alioth.debian.org to control@bugs.debian.org. (Mon, 04 Jan 2010 17:33:47 GMT) Full text and rfc822 format available.

Reply sent to Matthias Klose <doko@debian.org>:
You have taken responsibility. (Sat, 09 Jan 2010 13:36:11 GMT) Full text and rfc822 format available.

Notification sent to Thorsten Glaser <tg@mirbsd.de>:
Bug acknowledged by developer. (Sat, 09 Jan 2010 13:36:11 GMT) Full text and rfc822 format available.

Message #36 received at 541535-close@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@debian.org>
To: 541535-close@bugs.debian.org
Subject: Bug#541535: fixed in binutils 2.20-5
Date: Sat, 09 Jan 2010 13:32:40 +0000
Source: binutils
Source-Version: 2.20-5

We believe that the bug you reported is fixed in the latest version of
binutils, which is due to be installed in the Debian FTP archive:

binutils-dev_2.20-5_i386.deb
  to main/b/binutils/binutils-dev_2.20-5_i386.deb
binutils-doc_2.20-5_all.deb
  to main/b/binutils/binutils-doc_2.20-5_all.deb
binutils-gold_2.20-5_i386.deb
  to main/b/binutils/binutils-gold_2.20-5_i386.deb
binutils-multiarch_2.20-5_i386.deb
  to main/b/binutils/binutils-multiarch_2.20-5_i386.deb
binutils-source_2.20-5_all.deb
  to main/b/binutils/binutils-source_2.20-5_all.deb
binutils_2.20-5.diff.gz
  to main/b/binutils/binutils_2.20-5.diff.gz
binutils_2.20-5.dsc
  to main/b/binutils/binutils_2.20-5.dsc
binutils_2.20-5_i386.deb
  to main/b/binutils/binutils_2.20-5_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 541535@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated binutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 09 Jan 2010 10:43:04 +0100
Source: binutils
Binary: binutils binutils-dev binutils-multiarch binutils-gold binutils-hppa64 binutils-spu binutils-doc binutils-source
Architecture: source all i386
Version: 2.20-5
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Description: 
 binutils   - The GNU assembler, linker and binary utilities
 binutils-dev - The GNU binary utilities (BFD development files)
 binutils-doc - Documentation for the GNU assembler, linker and binary utilities
 binutils-gold - The (experimental) GNU gold linker utility
 binutils-hppa64 - The GNU assembler, linker and binary utilities targeted for hppa6
 binutils-multiarch - Binary utilities that support multi-arch targets
 binutils-source - The GNU assembler, linker and binary utilities (source)
 binutils-spu - The GNU assembler, linker and binary utilities targeted for spu-e
Closes: 541535 553916 555012 559183 562822 563366
Changes: 
 binutils (2.20-5) unstable; urgency=low
 .
   * Apply updates from the 2.20 branch up to 20100109
   * Apply patches from the trunk:
     - [arm] Prevent disassembler from aborting on an invalid Thumb2 instruction.
     - Fix PR gold/11072: Discard .gnu_debuglink sections.  Closes: #563366.
     - Fix PR ld/11138: internal error when DSO is before object files.
       Closes: #562822.
     - Fix PR gold/11042: COPY relocs need for the dynamic object.
       Closes: #559183.
     - Fix PR gold/10916: Fix --exclude-libs with undefined symbol.
       Closes: #555012.
     - Fix PR gold/10979: gold linker crashes. Closes: #553916.
     - Fix PR gas/10740: Intel syntax far jumps broken. Closes: #541535.
Checksums-Sha1: 
 703afebeb9ca84e666ff8acf25bdf77032adbe79 1298 binutils_2.20-5.dsc
 4daef48aa7f2fa11ed10d6a611264e2a664e25a6 91779 binutils_2.20-5.diff.gz
 1dcbb6ee40cbbc4c6df5d49348870947ee25dee7 547428 binutils-doc_2.20-5_all.deb
 a0811d94f7b7e5c306af69311968904b02c83045 16310490 binutils-source_2.20-5_all.deb
 71a6cd087e21ddc6db85a736cd254522de0e91f0 3239738 binutils_2.20-5_i386.deb
 f5690a1854526db5bf125ae44b741ad336cd71a8 3457176 binutils-dev_2.20-5_i386.deb
 e2e5cf2183cd07d130683a376f2f46f280afebfb 1983570 binutils-multiarch_2.20-5_i386.deb
 12f7984ad29d89ec449b7d4e82d06988c9b4c701 566132 binutils-gold_2.20-5_i386.deb
Checksums-Sha256: 
 7b7564d688bcd1dc01712910dea2ca1fe13a1876ccf7d9f48f8d2d3da5e2ef7c 1298 binutils_2.20-5.dsc
 ce351780e78bb54ad034f10ddd2182fd185435292a0124cc6f02cbf86c43c6ba 91779 binutils_2.20-5.diff.gz
 de6d788f65b819330cbba3bda0f4fb471a41d148a1624141cfc7a81b94bd9474 547428 binutils-doc_2.20-5_all.deb
 85c5ef573da655300f9094dcc791584c52481c9e7b5f899dcce0670c678956fa 16310490 binutils-source_2.20-5_all.deb
 75f568840dba61a413d4fb0b860ecab8e54f9d1650327d101ccd95e166f194aa 3239738 binutils_2.20-5_i386.deb
 eba86eb1b1e91f57bbdf9f0674b38a60907ea4a414dd9be2ab18b0875e50bd03 3457176 binutils-dev_2.20-5_i386.deb
 b9dd90de4a5c6e6459f8bd87129bee8d45d2134bdd0144cecba6aefef4ea9002 1983570 binutils-multiarch_2.20-5_i386.deb
 8393182f03bd80f9723e3bbbb1b756fb221b780f491387734379164e5568eea8 566132 binutils-gold_2.20-5_i386.deb
Files: 
 731544f92727885c9cdef99a5a8def75 1298 devel optional binutils_2.20-5.dsc
 1d49ca15e02475909cf807bc9b9a8c3e 91779 devel optional binutils_2.20-5.diff.gz
 07bbda2c97f5b150043b1c4222652830 547428 doc optional binutils-doc_2.20-5_all.deb
 ea73e21ff02870af6194f202ca44db14 16310490 devel optional binutils-source_2.20-5_all.deb
 6d762d46297a5fce808a4212913a0eba 3239738 devel optional binutils_2.20-5_i386.deb
 e29590154f613267083e004ddc33cc0d 3457176 devel extra binutils-dev_2.20-5_i386.deb
 eb8666d3de7ba777b294ef7ff068b291 1983570 devel extra binutils-multiarch_2.20-5_i386.deb
 e463bcd5603c57d5b520d2e356174382 566132 devel extra binutils-gold_2.20-5_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAktIg18ACgkQStlRaw+TLJzpZwCgnpsdlN3ycd0Sqz6Zlfpt+QGM
8AgAn1oY0sD8aWb+2RG/iIiD4lEu7Mgo
=Qdfp
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 18 Feb 2010 07:33:53 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 23:02:23 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.