Assertion failure in 2.18
I'm getting the following error: as: BFD (GNU Binutils for Ubuntu) 2.18 assertion fail ../../bfd/elf.c:6239 as: BFD (GNU Binutils for Ubuntu) 2.18 internal error, aborting at ../../bfd/elfcode.h line 221 in bfd_elf64_swap_symbol_out This only happens when I build with no -O3; once I specify -O3, this seems to go away. I'm just jumping into a moderately sized codebase for an OS kernel with no kernel hacking experience, so it would take me some time to debug this. Any ideas what this is caused by? Thanks in advance. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[PATCH 1/2] gas/as.c: print input and output details when error
Print input and output details (filename, inode number) when error, this makes the debug easier. Signed-off-by: Robert Yang --- gas/as.c | 4 +++- gas/as.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gas/as.c b/gas/as.c index 02c7d29..6afe9a5 100644 --- a/gas/as.c +++ b/gas/as.c @@ -1259,8 +1259,10 @@ main (int argc, char ** argv) if (sib.st_ino == sob.st_ino && sib.st_ino != 0) { /* Don't let as_fatal remove the output file! */ + saved_out_file_name = xstrdup (out_file_name); out_file_name = NULL; - as_fatal (_("The input and output files must be distinct")); + as_fatal (_("The input (%s, ino: %ld) and output (%s, ino: %ld) files must be distinct"), + argv[i], sib.st_ino, saved_out_file_name, sob.st_ino); } } } diff --git a/gas/as.h b/gas/as.h index 52bb5a7..d97d9b5 100644 --- a/gas/as.h +++ b/gas/as.h @@ -375,6 +375,7 @@ COMMON int flag_noexecstack; /* name of emitted object file */ COMMON const char *out_file_name; +COMMON const char *saved_out_file_name; /* name of file defining extensions to the basic instruction set */ COMMON char *insttbl_file_name; -- 2.7.4 ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[PATCH 2/2] gas/as.c: compare device id
Different files may have the same inode number on different devices, for example: $ cat foo.c | gcc -x c - -o /dev/null In this case, gcc will create a /tmp/foo.s, and if /tmp is a tmpfs, foo.s' ino starts from a small number such 3, and /dev/null's ino is also small (e.g., 6), so this is very likely to happen when there are many gcc's runs. Compare device id will fix the problem. Signed-off-by: Robert Yang --- gas/as.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gas/as.c b/gas/as.c index 6afe9a5..becc7d2 100644 --- a/gas/as.c +++ b/gas/as.c @@ -1256,7 +1256,7 @@ main (int argc, char ** argv) if (stat (argv[i], &sib) == 0) { - if (sib.st_ino == sob.st_ino && sib.st_ino != 0) + if (sib.st_ino == sob.st_ino && sib.st_ino != 0 && sib.st_dev == sib.st_dev) { /* Don't let as_fatal remove the output file! */ saved_out_file_name = xstrdup (out_file_name); -- 2.7.4 ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
Gobjdump on Mac
Hi: I am running binutils 2.15 on OS X 10.4. I compiled code with -g option and ran gobjdump with -S option. The output of gobjdump only lists the assembly code without source code intermixed. I run same tool on Linux machine (Redhat), the assembly code is intermixed with source code. Thanks Mitch ** The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email. ** ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
2.6.19-rc2 has ld error for ppc64
On building 2.6.19-rc2 on ppc64, ld always reports such an error: ".text exceeds stub group size" ... this patch can make ld happy without any complain. --- binutils-2.17/bfd/elf64-ppc.c.orig 2006-10-16 23:58:53.0 -0400 +++ binutils-2.17/bfd/elf64-ppc.c 2006-10-16 18:43:57.0 -0400 @@ -4538,6 +4538,7 @@ ppc64_elf_check_relocs (bfd *abfd, struc case R_PPC64_REL14_BRTAKEN: case R_PPC64_REL14_BRNTAKEN: { + htab->has_14bit_branch = 0; asection *dest = NULL; /* Heuristic: If jumping outside our section, chances are ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
Re: 2.6.19-rc2 has ld error for ppc64
Alan Modra 写道: On Tue, Oct 17, 2006 at 07:11:51PM +0800, Yi CDL Yang wrote: On building 2.6.19-rc2 on ppc64, ld always reports such an error: ".text exceeds stub group size" This is not an error. It is just a warning that might help explain a later error. If the linker doesn't give any errors then the warning may safely be ignored. Many warnings aren't a good thing, we should have a clean build, this patch should be good. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/5494] New: No source debugging information with relative path by objdump
gcc -g -c ./src/hello.c -o ./obj/hello.o cd obj objdump -S hello.o No source debugging information can be seen in hello.o hello.o: file format elf32-i386 Disassembly of section .text: : 0: 55 push %ebp 1: 89 e5 mov%esp,%ebp 3: 83 ec 08sub$0x8,%esp 6: 83 e4 f0and$0xfff0,%esp 9: b8 00 00 00 00 mov$0x0,%eax e: 83 c0 0fadd$0xf,%eax 11: 83 c0 0fadd$0xf,%eax 14: c1 e8 04shr$0x4,%eax 17: c1 e0 04shl$0x4,%eax 1a: 29 c4 sub%eax,%esp 1c: 83 ec 0csub$0xc,%esp 1f: 68 00 00 00 00 push $0x0 24: e8 fc ff ff ff call 25 29: 83 c4 10add$0x10,%esp 2c: b8 00 00 00 00 mov$0x0,%eax 31: c9 leave 32: c3 ret gcc -g -c /home/yangzx/src/hello.c -o /home/yangzx/obj/hello.o Source debugging information can be seen in hello.o hello.o: file format elf32-i386 Disassembly of section .text: : #include int main(void) { 0: 55 push %ebp 1: 89 e5 mov%esp,%ebp 3: 83 ec 08sub$0x8,%esp 6: 83 e4 f0and$0xfff0,%esp 9: b8 00 00 00 00 mov$0x0,%eax e: 83 c0 0fadd$0xf,%eax 11: 83 c0 0fadd$0xf,%eax 14: c1 e8 04shr$0x4,%eax 17: c1 e0 04shl$0x4,%eax 1a: 29 c4 sub%eax,%esp printf("hello world\n"); 1c: 83 ec 0csub$0xc,%esp 1f: 68 00 00 00 00 push $0x0 24: e8 fc ff ff ff call 25 29: 83 c4 10add$0x10,%esp return 0; 2c: b8 00 00 00 00 mov$0x0,%eax } 31: c9 leave 32: c3 ret -- Summary: No source debugging information with relative path by objdump Product: binutils Version: 2.17 Status: NEW Severity: normal Priority: P2 Component: binutils AssignedTo: unassigned at sources dot redhat dot com ReportedBy: moonlight dot yang at gmail dot com CC: bug-binutils at gnu dot org http://sourceware.org/bugzilla/show_bug.cgi?id=5494 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug binutils/5494] No source debugging information with relative path by objdump
--- Additional Comments From moonlight dot yang at gmail dot com 2007-12-31 15:02 --- Tried on Fedora 8 with objdump 2.17.50.0.18-1 20070731 and it worked It didn't work on Fedora Core 6 (Sorry. I don't remember the version of objdump. Come with the distribution CD). I think this bug has been fixed in the latest version. -- http://sourceware.org/bugzilla/show_bug.cgi?id=5494 --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. ___ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils