forked from Imagelibrary/binutils-gdb
non-LVU: error if .[su]leb128's operand is undefined
This commit is contained in:
@@ -394,6 +394,7 @@ if { ![istarget "tic4x*-*-*"] && ![istarget "tic54x*-*-*"] } {
|
||||
run_dump_test sleb128-7
|
||||
run_dump_test sleb128-8
|
||||
}
|
||||
run_dump_test sleb128-9
|
||||
|
||||
# .byte is 32 bits on tic4x, and .p2align isn't supported on tic54x
|
||||
# .space is different on hppa*-hpux.
|
||||
|
||||
4
gas/testsuite/gas/all/sleb128-9.d
Normal file
4
gas/testsuite/gas/all/sleb128-9.d
Normal file
@@ -0,0 +1,4 @@
|
||||
#name: undefined symbols un sleb128 directive
|
||||
#source: sleb128-9.s
|
||||
#error-output: sleb128-9.l
|
||||
#target: *-*-*
|
||||
3
gas/testsuite/gas/all/sleb128-9.l
Normal file
3
gas/testsuite/gas/all/sleb128-9.l
Normal file
@@ -0,0 +1,3 @@
|
||||
[^:]*: Assembler messages:
|
||||
[^:]*:2: Error: leb128 operand is an undefined symbol: \.Lundef
|
||||
[^:]*:3: Error: leb128 operand is an undefined symbol: undef
|
||||
3
gas/testsuite/gas/all/sleb128-9.s
Normal file
3
gas/testsuite/gas/all/sleb128-9.s
Normal file
@@ -0,0 +1,3 @@
|
||||
.data
|
||||
.sleb128 .Lundef
|
||||
.sleb128 undef
|
||||
@@ -2447,6 +2447,13 @@ relax_segment (struct frag *segment_frag_root, segT segment, int pass)
|
||||
#endif
|
||||
|
||||
case rs_leb128:
|
||||
if (pass == 0 && !S_IS_DEFINED (fragP->fr_symbol))
|
||||
{
|
||||
as_bad_where (fragP->fr_file, fragP->fr_line,
|
||||
_("leb128 operand is an undefined symbol: %s"),
|
||||
S_GET_NAME (fragP->fr_symbol));
|
||||
}
|
||||
|
||||
/* Initial guess is always 1; doing otherwise can result in
|
||||
stable solutions that are larger than the minimum. */
|
||||
address += fragP->fr_offset = 1;
|
||||
|
||||
Reference in New Issue
Block a user