Bug 10903 - .fill regression
Summary: .fill regression
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks: 876
  Show dependency treegraph
 
Reported: 2009-11-04 17:43 UTC by H.J. Lu
Modified: 2009-11-04 19:25 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2009-11-04 17:43:46 UTC
[hjl@gnu-26 tmp]$ cat x.s
                .text
		.org 0xf00
		.byte 8
_end:
                .fill   4096 - _end
_foo:
[hjl@gnu-26 tmp]$ /usr/bin/as -v --32 -o x.o x.s  
GNU assembler version 2.15.92.0.2 (x86_64-redhat-linux) using BFD version
2.15.92.0.2 20040927
[hjl@gnu-26 tmp]$ readelf -s x.o

Symbol table '.symtab' contains 6 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 SECTION LOCAL  DEFAULT    1 
     2: 00000000     0 SECTION LOCAL  DEFAULT    2 
     3: 00000000     0 SECTION LOCAL  DEFAULT    3 
     4: 00000f01     0 NOTYPE  LOCAL  DEFAULT    1 _end
     5: 00001000     0 NOTYPE  LOCAL  DEFAULT    1 _foo

[hjl@gnu-26 tmp]$ as -v --32 -o x.o x.s  
GNU assembler version 2.20.51.0.3 (x86_64-unknown-linux-gnu) using BFD version
(Linux/GNU Binutils) 2.20.51.0.3.20091021
x.s: Assembler messages:
x.s:5: Error: .space specifies non-absolute value
[hjl@gnu-26 tmp]$
Comment 1 H.J. Lu 2009-11-04 18:19:06 UTC
It is caused by symbols.c change in

http://sourceware.org/ml/binutils-cvs/2005-05/msg00163.html
Comment 2 H.J. Lu 2009-11-04 18:20:00 UTC
The symbols.c patch is for PR 876.
Comment 3 H.J. Lu 2009-11-04 19:25:10 UTC
The code is wrong. It should be rewritten as

                .text
                .org 0xf00
org:
                .byte 8
_end:
                .fill  4096 - (_end - org + 0xf00)
_foo: