From: Alexey Sheplyakov <asheplyakov@basealt.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] armh + libjpeg + c++ exceptions
Date: Mon, 22 Jun 2020 19:27:00 +0400
Message-ID: <98c5fdf0-c4bb-cc19-cf81-fd9e2f011e03@basealt.ru> (raw)
In-Reply-To: <048dc43b-7585-02df-41b5-48be0ea73e78@basealt.ru>
On 6/22/20 6:39 PM, Alexey Sheplyakov wrote:
>> Там же есть ссылка на баг
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=9265,
>> но в нем я пока не разобрался.
>>
>> Добавление "-x c++" мне не помогло.
>> Надеюсь, что специалисты по gcc что-нибудь посоветуют.
>
> Тут, возможно, не специалисты по gcc, а специалисты по glibc и/или
> binutils потребуются.
>
> Я таковым не являюсь, но все равно немного потыкаю палочкой в этот
> замечательный примерчик.
Нельзя просто так взять и заставить C код бросать (C++) исключения.
Как минимум нужно
1) использовать для линковки g++ (не всегда
эквивалентно gcc -x c++ -lstdc++)
2) все задействованные библиотеки собирать так, чтоб в них был GNU_EH_FRAME
А у нас в armh его нет:
$ wget -N
http://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/armh/RPMS.classic/libjpeg-2.0.2-alt1.armh.rpm
$ mkdir -p _tmp && cd _tmp && rpm2cpio ../libjpeg-2.0.2-alt1.armh.rpm |
cpio --extract --make-directories
$ readelf -l usr/lib/libjpeg.so.62
Elf file type is DYN (Shared object file)
Entry point 0x1a50
There are 6 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x28ca4 0x28ca4 R E 0x10000
LOAD 0x028d00 0x00038d00 0x00038d00 0x00498 0x0049c RW 0x10000
DYNAMIC 0x028f10 0x00038f10 0x00038f10 0x000f0 0x000f0 RW 0x4
NOTE 0x0000f4 0x000000f4 0x000000f4 0x00024 0x00024 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
GNU_RELRO 0x028d00 0x00038d00 0x00038d00 0x00300 0x00300 R 0x1
Section to Segment mapping:
Segment Sections...
00 .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version
.gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame
01 .init_array .fini_array .data.rel.ro .dynamic .got .bss
02 .dynamic
03 .note.gnu.build-id
04
05 .init_array .fini_array .data.rel.ro .dynamic
Выясняю, куда и почему он делся.
next prev parent reply other threads:[~2020-06-22 15:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 10:41 Vladislav Zavjalov
2020-06-22 14:39 ` Alexey Sheplyakov
2020-06-22 15:27 ` Alexey Sheplyakov [this message]
2020-06-22 15:46 ` Alexey Sheplyakov
2020-06-22 22:01 ` Alexey Sheplyakov
2020-06-23 9:49 ` Vladislav Zavjalov
2020-06-23 15:29 ` Alexey Sheplyakov
2020-06-23 16:49 ` Vladislav Zavjalov
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=98c5fdf0-c4bb-cc19-cf81-fd9e2f011e03@basealt.ru \
--to=asheplyakov@basealt.ru \
--cc=devel@lists.altlinux.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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git