Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Sangamesh Mallayya" <sangamesh.swamy@in.ibm.com>
To: gdb-patches@sourceware.org
Subject: Re: set sysroot command on AIX has no effect.
Date: Tue, 27 Sep 2016 11:39:00 -0000	[thread overview]
Message-ID: <OF5F1DC4DF.51665DEE-ON6525803B.00390F44-6525803B.00391EF3@notes.na.collabserv.com> (raw)
In-Reply-To: <OFBAE0EEF6.511F8BA2-ON6525802D.00305F69-6525802D.0031DA2D@LocalDomain>

Hi,

Please review the attached patch and let me know the comments.

Thanks & Regards,
-Sangamesh
AIX BOS Development



From:   Sangamesh Mallayya/India/IBM
To:     gdb-patches@sourceware.org
Date:   09/13/2016 02:34 PM
Subject:        set sysroot command on AIX has no effect.


set sysroot command on AIX has no effect if a program depends on shared 
library archives (.a).

This is the original behaviour if we use "set sysroot" command.

(gdb) set sysroot /tmp
warning: while parsing aix library list: no element found
(gdb) file /home/sysroot/testApp
Reading symbols from /home/sysroot/testApp...done.
(gdb) core-file /home/sysroot/core
warning: core file may not match specified executable file.
warning: Unexpected size of section `.reg' in core file.
warning: Could not open `/home/sysroot/libTest.a' as an executable file: A 
file or directory in the path name does not exist.
warning: Could not load shared library symbols for 
/home/sysroot/libTest.a(func.o).
Do you need "set solib-search-path" or "set sysroot"?
Program terminated with signal SIGABRT, Aborted.
warning: Unexpected size of section `.reg' in core file.
#0  0xd013a820 in raise () from /usr/lib/libc.a(shr.o)
(gdb) info sharedlibrary 
From        To          Syms Read   Shared Object Library
0xd04da240  0xd04daa3e  Yes (*)     /usr/lib/libcrypt.a(shr.o)
                                        No /home/sysroot/libTest.a(func.o)
0xd010c880  0xd049b13d  Yes (*)     /usr/lib/libc.a(shr.o)
(*): Shared library is missing debugging information.
(gdb) bt
#0  0xd013a820 in raise () from /usr/lib/libc.a(shr.o)
#1  0xd01b3088 in abort () from /usr/lib/libc.a(shr.o)
#2  0xd2fd82a4 in ?? ()
#3  0x100003a4 in main () at main.c:8
(gdb) 
 

After applying the attached patch.
Patch doesn't cause any change in original behaviour while handling shared 
library with .so names.

".a" name archives case.

(gdb) set sysroot /tmp 
warning: while parsing aix library list: no element found
(gdb) file /home/sysroot/testApp 
Reading symbols from /home/sysroot/testApp...done.
(gdb) core-file /home/sysroot/core
warning: core file may not match specified executable file.
warning: Unexpected size of section `.reg' in core file.
Program terminated with signal SIGABRT, Aborted.
warning: Unexpected size of section `.reg' in core file.
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
(gdb) inf sharedlibrary 
From             To                   Syms Read   Shared Object Library
0xd04da240  0xd04daa3e  Yes    (*)       /tmp/usr/lib/libcrypt.a(shr.o)
0xd2fd6250   0xd2fd64aa   Yes /tmp/home/sysroot/libTest.a(func.o)
0xd010c880  0xd049b13d  Yes    (*)       /tmp/usr/lib/libc.a(shr.o)
(*): Shared library is missing debugging information.
(gdb) bt
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
#1  0xd01b3088 in abort () from /tmp/usr/lib/libc.a(shr.o)
#2  0xd2fd6364 in func () from /tmp/home/sysroot/libTest.a(func.o)
#3  0x100003a4 in main () at main.c:8
(gdb) 


.a & .so library names

(gdb) set sysroot /tmp
warning: while parsing aix library list: no element found
(gdb) file /home/sysroot/testApp 
Reading symbols from /home/sysroot/testApp...done.
(gdb) core-file /home/sysroot/core
warning: core file may not match specified executable file.
warning: Unexpected size of section `.reg' in core file.
Program terminated with signal SIGABRT, Aborted.
warning: Unexpected size of section `.reg' in core file.
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
(gdb) info sharedlibrary 
From             To                   Syms Read   Shared Object Library
0xd04da240  0xd04daa3e  Yes    (*)        /tmp/usr/lib/libcrypt.a(shr.o)
0xd2536250  0xd25499fc   Yes 
/tmp/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/libgcc_s.a(shr.o)
0xd0566c80  0xd0566db6  Yes    (*)        /tmp/usr/lib/librtl.a(shr.o)
0xd010c880  0xd049b13d  Yes    (*)        /tmp/usr/lib/libc.a(shr.o)
0xd2fd7150   0xd2fd78e1   Yes               /tmp/home/sysroot/libTest.so
(*): Shared library is missing debugging information.
(gdb) bt
#0  0xd013a820 in raise () from /tmp/usr/lib/libc.a(shr.o)
#1  0xd01b3088 in abort () from /tmp/usr/lib/libc.a(shr.o)
#2  0xd2fd749c in func () from /tmp/home/sysroot/libTest.so
#3  0x100003fc in main () at main.c:8
(gdb)


Please review and let me know the comments.

[attachment "ChangeLog" deleted by Sangamesh Mallayya/India/IBM] 
[attachment "set_sysroot.patch" deleted by Sangamesh Mallayya/India/IBM] 

Thanks & Regards,
-Sangamesh
AIX BOS Development



       reply	other threads:[~2016-09-27 10:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OFBAE0EEF6.511F8BA2-ON6525802D.00305F69-6525802D.0031DA2D@LocalDomain>
2016-09-27 11:39 ` Sangamesh Mallayya [this message]
2016-09-13  9:05 Sangamesh Mallayya
2016-09-29 15:33 ` Ulrich Weigand
2016-09-30 14:15   ` Sangamesh Mallayya
2016-09-30 14:38     ` Ulrich Weigand
2016-10-04 13:19       ` Sangamesh Mallayya
2016-10-07 19:31         ` Ulrich Weigand
2016-10-08 13:15           ` Sangamesh Mallayya
2016-10-08 14:38             ` Ulrich Weigand
2016-10-10 12:11               ` Sangamesh Mallayya
2016-10-10 16:29                 ` Ulrich Weigand
2016-10-11  7:17                   ` Ulrich Weigand
2016-10-13 13:42                     ` Sangamesh Mallayya
2016-10-13 14:03                       ` Ulrich Weigand
2016-10-13 17:44                         ` Sangamesh Mallayya
2016-10-14 13:13                           ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF5F1DC4DF.51665DEE-ON6525803B.00390F44-6525803B.00391EF3@notes.na.collabserv.com \
    --to=sangamesh.swamy@in.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox