This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug shlibs/11293] gdb is broken on Linux/i386


------- Additional Comments From hjl dot tools at gmail dot com  2010-02-17 20:02 -------
This code

---
            if (addr_bit < (sizeof (ULONGEST) * HOST_CHAR_BIT))
              {    
                CORE_ADDR space_size = (ULONGEST) 1 << addr_bit;
                CORE_ADDR tmp_entry_point = exec_entry_point (tmp_bfd,
                                                              tmp_bfd_target);

                gdb_assert (load_addr < space_size);

                /* TMP_ENTRY_POINT exceeding SPACE_SIZE would be for prelinked
                   64bit ld.so with 32bit executable, it should not happen.  */

                if (tmp_entry_point < space_size
                    && tmp_entry_point + load_addr >= space_size)
                  load_addr -= space_size;
              }    
---

doesn't make much senses. For 32bit, addr_bit is 32 and CORE_ADDR is
4 byte.

CORE_ADDR space_size = (ULONGEST) 1 << addr_bit;

will overflow.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11293

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]