Summary: | sys-devel/gdb-6.4 doesn't work with hardened toolchain | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Peter Simons <simons> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Peter Simons
2006-02-18 11:16:06 UTC
Um, you probably guessed it anyway, but I meant gcc 3.3.6 above, not 3.6.6. ok; two things: 1) you need to link with -nopie; hardened toolchain switches on PIE automatically, and the Gentoo gdb doesn't support PIEs. You can compile with pie, but you need to do the final link -nopie: g++ -c test.cpp g++ -nopie test.o one way to do this with ebuilds is to add '-nopie' to LDFLAGS temporarily: LDFLAGS="-nopie" ebuild <peth-to-ebuild> compile provided the ebuild honours LDFLAGS (which it should in the majority of cases). 2) If you're running a kernel with the PaX mprotect restrictions on, you'll need to relax the mprotect restrictions; i.e. do: /sbin/paxctl -m a.out Re-open if the above doesn't work for you. Thanks a lot for your response, Kevin. Adding -nopie at link-time did the trick. I had tried building gdb with PIE disabled, but it never occurred to me to do that with the application that is being debugged. In the sake of other users who might run into the same problem: Maybe the gdb ebuild should print an "einfo" item after merging the debugger? That would have helped me. Anyway, thanks again. |