[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/15780] .gnu.warning.SYMBOL section treatment needs improvement
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/15780] .gnu.warning.SYMBOL section treatment needs improvement |
Date: |
Fri, 26 Jul 2013 15:09:23 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=15780
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
address@hidden pr15780]$ cat end.c
#include <stdio.h>
void
foo ()
{
printf ("TEST1\n");
}
address@hidden pr15780]$ cat beginwarn.c
static const char _evoke_link_warning_foo []
__attribute__ ((used, section (".gnu.warning.foo")))
= "function foo is deprecated";
extern void foo (void);
static void (*const init_array []) (void)
__attribute__ ((used, section (".init_array"), aligned (sizeof (void *))))
= { foo };
address@hidden pr15780]$ make
gcc -fPIC -fPIC -c -o end.o end.c
gcc -fPIC -fPIC -c -o beginwarn.o beginwarn.c
./ld -shared -o libfoo.so end.o beginwarn.o
beginwarn.o:(.init_array+0x0): warning: function foo is deprecated
readelf -SlW libfoo.so
There are 18 section headers, starting at offset 0x540:
Section Headers:
[Nr] Name Type Address Off Size ES Flg
Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00
0 0 0
[ 1] .hash HASH 0000000000000120 000120 000030 04 A
2 0 8
[ 2] .dynsym DYNSYM 0000000000000150 000150 0000a8 18 A
3 2 8
[ 3] .dynstr STRTAB 00000000000001f8 0001f8 000022 00 A
0 0 1
[ 4] .rela.dyn RELA 0000000000000220 000220 000018 18 A
2 0 8
[ 5] .rela.plt RELA 0000000000000238 000238 000018 18 A
2 6 8
[ 6] .plt PROGBITS 0000000000000250 000250 000020 10 AX
0 0 16
[ 7] .text PROGBITS 0000000000000270 000270 000012 00 AX
0 0 1
[ 8] .rodata PROGBITS 0000000000000282 000282 000006 00 A
0 0 1
[ 9] .gnu.warning.foo PROGBITS 0000000000000290 000290 00001b 00 A
0 0 16
[10] .eh_frame PROGBITS 00000000000002b0 0002b0 000060 00 A
0 0 8
[11] .init_array INIT_ARRAY 0000000000200310 000310 000008 00 WA
0 0 8
[12] .dynamic DYNAMIC 0000000000200318 000318 000140 10 WA
3 0 8
[13] .got.plt PROGBITS 0000000000200458 000458 000020 08 WA
0 0 8
[14] .comment PROGBITS 0000000000000000 000478 00002c 01 MS
0 0 1
[15] .shstrtab STRTAB 0000000000000000 0004a4 000095 00
0 0 1
[16] .symtab SYMTAB 0000000000000000 0009c0 000288 18
17 22 8
[17] .strtab STRTAB 0000000000000000 000c48 000076 00
0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Elf file type is DYN (Shared object file)
Entry point 0x270
There are 4 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz
Flg Align
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x000310
0x000310 R E 0x200000
LOAD 0x000310 0x0000000000200310 0x0000000000200310 0x000168
0x000168 RW 0x200000
DYNAMIC 0x000318 0x0000000000200318 0x0000000000200318 0x000140
0x000140 RW 0x8
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000
0x000000 RW 0x10
Section to Segment mapping:
Segment Sections...
00 .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text .rodata
.gnu.warning.foo .eh_frame
01 .init_array .dynamic .got.plt
02 .dynamic
03
address@hidden pr15780]$
.gnu.warning.foo section is in PT_LOAD segment.
--
You are receiving this mail because:
You are on the CC list for the bug.