Обсуждение: PG_MODULE_MAGIC lost if strip the object file

Поиск
Список
Период
Сортировка

PG_MODULE_MAGIC lost if strip the object file

От
Michael Enke
Дата:
Hi list,
I create a dynamic library with the PG_MODULE_MAGIC under Linux.
No problem in normal situation, but if I strip the .o file,
that information seems to get lost and I get:
ERROR:  incompatible library "...so": missing magic block
TIP:  Extension libraries are required to use the PG_MODULE_MAGIC macro.

I want to strip my code to make it harder to use gdb on it.
Any suggestion how I can get it working "with" stripping the .o file?

Thanks,
Michael

--
WINCOR NIXDORF International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Gesch�ftsf�hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J�rgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193

Diese E-Mail enth�lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt�mlich
erhaltenhaben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
dieunbefugte Weitergabe dieser E-Mail ist nicht gestattet. 

This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail
inerror) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distributionof the material in this e-mail is strictly forbidden.  


Re: PG_MODULE_MAGIC lost if strip the object file

От
Alvaro Herrera
Дата:
Michael Enke wrote:
> Hi list,
> I create a dynamic library with the PG_MODULE_MAGIC under Linux.
> No problem in normal situation, but if I strip the .o file,
> that information seems to get lost and I get:
> ERROR:  incompatible library "...so": missing magic block
> TIP:  Extension libraries are required to use the PG_MODULE_MAGIC macro.
>
> I want to strip my code to make it harder to use gdb on it.
> Any suggestion how I can get it working "with" stripping the .o file?

How about not compiling with -g?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: PG_MODULE_MAGIC lost if strip the object file

От
Tom Lane
Дата:
Michael Enke <michael.enke@wincor-nixdorf.com> writes:
> I create a dynamic library with the PG_MODULE_MAGIC under Linux.
> No problem in normal situation, but if I strip the .o file,
> that information seems to get lost and I get:
> ERROR:  incompatible library "...so": missing magic block
> TIP:  Extension libraries are required to use the PG_MODULE_MAGIC macro.

Don't strip global symbols.

            regards, tom lane

Re: PG_MODULE_MAGIC lost if strip the object file

От
Michael Enke
Дата:
Alvaro Herrera wrote:
> Michael Enke wrote:
>
>>Hi list,
>>I create a dynamic library with the PG_MODULE_MAGIC under Linux.
>>No problem in normal situation, but if I strip the .o file,
>>that information seems to get lost and I get:
>>ERROR:  incompatible library "...so": missing magic block
>>TIP:  Extension libraries are required to use the PG_MODULE_MAGIC macro.
>>
>>I want to strip my code to make it harder to use gdb on it.
>>Any suggestion how I can get it working "with" stripping the .o file?
>
>
> How about not compiling with -g?
>

I do not compile with -g.

--
WINCOR NIXDORF International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Gesch�ftsf�hrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. J�rgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193

Diese E-Mail enth�lt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt�mlich
erhaltenhaben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
dieunbefugte Weitergabe dieser E-Mail ist nicht gestattet. 

This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail
inerror) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distributionof the material in this e-mail is strictly forbidden.