[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb-cvs
Subject:    gdb and binutils branch master updated. 6041179a7496602f881b6f0a8c0bc3a8f1742cb7
From:       brobecke () sourceware ! org
Date:       2014-10-29 13:11:45
Message-ID: 20141029131145.15838.qmail () sourceware ! org
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  6041179a7496602f881b6f0a8c0bc3a8f1742cb7 (commit)
      from  6ae274b7dc305ae7cebcf55c5018dab05228235a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6041179a7496602f881b6f0a8c0bc3a8f1742cb7

commit 6041179a7496602f881b6f0a8c0bc3a8f1742cb7
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Thu Oct 23 08:25:20 2014 -0700

    ARM: stricter __stack_chk_guard check during prologue analysis
    
    We are trying to insert a breakpoint on line 4 for the following
    Ada code.
    
      3 procedure STR is
      4    XX : String (1 .. Blocks.Sz) := (others => 'X'); -- STOP
      5    K : Integer;
      6 begin
      7    K := 13;
    
    The code generated on ARM (-march=armv7-m) starts like this:
    
        (gdb) disass str'address
        Dump of assembler code for function _ada_str:
           --# Line str.adb:3
           0x08000014 <+0>:     push    {r4, r7, lr}
           0x08000016 <+2>:     sub     sp, #28
           0x08000018 <+4>:     add     r7, sp, #0
           0x0800001a <+6>:     mov     r3, sp
           0x0800001c <+8>:     mov     r4, r3
           --# Line str.adb:4
           0x0800001e <+10>:    ldr     r3, [pc, #84]   ; (0x8000074 <_ada_str+96>)
           0x08000020 <+12>:    ldr     r3, [r3, #0]
           0x08000022 <+14>:    str     r3, [r7, #20]
           0x08000024 <+16>:    ldr     r3, [r7, #20]
           [...]
    
    When computing the address related to str.adb:4, GDB correctly
    resolves it to 0x0800001e first, but then considers the next
    3 instructions as being part of the prologue because it thinks
    they are part of stack-protector code. As a result, instead
    of inserting the breakpoint at line 4, it skips those instruction
    and consequently the rest of the instructions until the start
    of the next line, which his line 7.
    
    The stack-protector code is expected to start like this...
    
            ldr     Rn, .Label
            ....
            .Lable:
            .word   __stack_chk_guard
    
    ... but the implementation actually accepts a sequence where
    the ldr location points to an address for which there is no symbol.
    It only aborts if the address points to a symbol which is not
    __stack_chk_guard.
    
    Since the __stack_chk_guard symbol is always expected to exist
    when used (it lives in .dynsym), this patch fixes the issue by
    requiring that the ldr gets the address of the __stack_chk_guard
    symbol. If the address could not be resolved, then it rejects
    the sequence as being stack-protector code.
    
    gdb/ChangeLog:
    
            * arm-tdep.c (arm_skip_stack_protector): Return early if
            address loaded by first "ldr" instruction does not have
            a corresponding minimal symbol.  Update comment.
    
    Tested on arm-eabi using AdaCore's testsuite.
    Tested on arm-linux-gnueabi by Yao as well.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog  |    6 ++++++
 gdb/arm-tdep.c |    9 ++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
gdb and binutils

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic