From: Kirk McKusick Date: Sat, 13 Nov 1982 11:02:03 +0000 (-0800) Subject: local jumps to globally declared labels must still use jmp instead of jbr X-Git-Tag: BSD-4_1c_2-Snapshot-Development~1871 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/b3f9e9d3b36a6186cae9717b5749167e1cde6953 local jumps to globally declared labels must still use jmp instead of jbr SCCS-vsn: usr.bin/pascal/src/lab.c 1.16 --- diff --git a/usr/src/usr.bin/pascal/src/lab.c b/usr/src/usr.bin/pascal/src/lab.c index 3e249fc07d..0b4e9778e7 100644 --- a/usr/src/usr.bin/pascal/src/lab.c +++ b/usr/src/usr.bin/pascal/src/lab.c @@ -1,6 +1,6 @@ /* Copyright (c) 1979 Regents of the University of California */ -static char sccsid[] = "@(#)lab.c 1.15 %G%"; +static char sccsid[] = "@(#)lab.c 1.16 %G%"; #include "whoami.h" #include "0.h" @@ -138,7 +138,17 @@ gotoop(s) * local goto. */ extlabname( extname , p -> symbol , bn ); - putprintf( " jbr %s" , 0 , extname ); + /* + * this is a jmp because it's a jump to a label that + * has been declared global. Although this branch is + * within this module the assembler will complain that + * the destination is a global symbol. The complaint + * arises because the assembler doesn't change jbr's + * into jmp's and consequently may cause a branch + * displacement overflow when the module is subsequently + * linked into the rest of the program. + */ + putprintf( " jmp %s" , 0 , extname ); } else { /* * Non-local goto.