[Bug binutils/30792] Rnglists section dump in readelf outputs one rangelist per CU

2023-09-22 Thread sevaa at sprynet dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30792

--- Comment #7 from Vsevolod Alekseyev  ---
Anyway, here is the patch with the current state of affairs. Feel free to ditch
the patch and let me know if you'd rather wait until I address the rest of
29267.

Tried to keep the coding style along the current conventions, although they
seem to vary within the same file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/30792] Rnglists section dump in readelf outputs one rangelist per CU

2023-09-22 Thread sevaa at sprynet dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30792

--- Comment #6 from Vsevolod Alekseyev  ---
Created attachment 15121
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15121&action=edit
Proposed patch

Fixes the issue at hand and a part of 29267

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug binutils/30792] Rnglists section dump in readelf outputs one rangelist per CU

2023-09-22 Thread sevaa at sprynet dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30792

--- Comment #5 from Vsevolod Alekseyev  ---
I think I have a workable fix. Tested on my little corpus of binaries against
llvm-dwarfdump. While at it, I've fixed issue #29267 regarding rangelists, but
not the loclists. Should I work on the latter, or submit a patch now?

Algorithm wise, I've reused the design philosophy of V4 rangelist dumping for
v5 sections. Rangelists are dumped by collecting offsets from the DW_AT_ranges
attributes, sorting, and then following each into the respective debug section.

I've tried to keep format changes to a minimum.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/30877] [BUG][RISCV]relro protection not working in riscv

2023-09-22 Thread sch...@linux-m68k.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30877

--- Comment #2 from Andreas Schwab  ---
RISC-V use small data sections (it does not set NO_SMALL_DATA), and use the
default of placing .sdata and .got after .data, thus relro for .got is not
supported.  In order to support relro, it needs to follow powerpc64 which
places .sdata and .got before .data (see ld/emulparams/elf64ppc.sh).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/30856] Regression: operand size mismatch for `push'

2023-09-22 Thread jbeulich at suse dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30856

--- Comment #8 from Jan Beulich  ---
https://sourceware.org/pipermail/binutils/2023-September/129587.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/30877] [BUG][RISCV]relro protection not working in riscv

2023-09-22 Thread akhilesh.k at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30877

--- Comment #1 from Akhilesh Kumar  ---
below are the test results on RISC_V target 

Summary 
Even we compiled this application with -z,relro,-z,now on pmap showing .got
address as RW  

Test Results :- 

user@starfive:~/akhilesh$ gcc -g -Wl,-z,relro,-z,now -o test test.c 
user@starfive:~/akhilesh$ readelf -a test | grep RELRO
  GNU_RELRO  0x0df8 0x1df8 0x1df8
user@starfive:~/akhilesh$ readelf -a test | grep NOW  
 0x001e (FLAGS)  BIND_NOW
 0x6ffb (FLAGS_1)Flags: NOW PIE
user@starfive:~/akhilesh$ gdb -q test
Reading symbols from test...
gdb-peda$ check
checkpoint  checksec
gdb-peda$ checksec 
Warning: 'set logging off', an alias for the command 'set logging enabled', is
deprecated.
Use 'set logging enabled off'.

Warning: 'set logging on', an alias for the command 'set logging enabled', is
deprecated.
Use 'set logging enabled on'.

CANARY: disabled
FORTIFY   : disabled
NX: ENABLED
PIE   : ENABLED
RELRO : FULL
gdb-peda$ 
gdb-peda$ b main 
Breakpoint 1 at 0x6ca: file test.c, line 7.
gdb-peda$ shel objdump -R test | grep printf 
Ambiguous command "shel objdump -R test | grep printf ": shell, shellcode.
gdb-peda$ shell objdump -R test | grep printf 
2028 R_RISCV_JUMP_SLOT  printf@GLIBC_2.27
gdb-peda$ b main 
Note: breakpoint 1 also set at pc 0x6ca.
Breakpoint 2 at 0x6ca: file test.c, line 7.
gdb-peda$ r
Starting program: /home/user/akhilesh/test 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
Warning: 'set logging off', an alias for the command 'set logging enabled', is
deprecated.
Use 'set logging enabled off'.

Warning: 'set logging on', an alias for the command 'set logging enabled', is
deprecated.
Use 'set logging enabled on'.



Breakpoint 1, main (argc=0x1, argv=0x3ff418) at test.c:7
7   size_t *p = (size_t *) strtol(argv[1], NULL, 16);
gdb-peda$ b main 
Note: breakpoints 1 and 2 also set at pc 0x2aa6ca.
Breakpoint 3 at 0x2aa6ca: file test.c, line 7.
gdb-peda$ p/x 0x2aa6ca -0x6ca + 0x002028
$1 = 0x2ac028

gdb-peda$ test 0x2ac028
Undefined command: "test".  Try "help".
gdb-peda$ r 0x2ac028
Starting program: /home/user/akhilesh/test 0x2ac028
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".


Breakpoint 1, main (argc=0x2, argv=0x3ff408) at test.c:7
7   size_t *p = (size_t *) strtol(argv[1], NULL, 16);
gdb-peda$ shell ps -s
  UID PID  PENDING  BLOCKED  IGNORED  
CAUGHT STAT TTYTIME COMMAND
 1000   28404  0001 00384004
4b813efb Ss   pts/1  0:02 -bash
 1000   28713   
 Tpts/1  0:01 find / -name libFLAC*
 1000   42749   01001000
0001080344e7 Sl+  pts/1  0:03 gdb -q test
 1000   42773   
 tpts/1  0:00 /home/user/akhilesh/test 0x2ac028
 1000   42774   
7391fef9 R+   pts/1  0:00 ps -s
gdb-peda$ shell p 
peda-session-test.txt   peda-session-test_partial.txt  
philwantsfish-gdb_commands-7b11f55/ philwantsfish-gdb_commands-7b11f55.zip

gdb-peda$ shell pmap 42773
42773:   /home/user/akhilesh/test 0x2ac028
002aa000  4K r-x-- test
002ab000  4K r test
002ac000  4K rw--- test== Showing RW even we used
-z,relro, -z, now 
003ff7e9d000   1160K r-x-- libc.so.6
003ff7fbf000 12K r libc.so.6
003ff7fc2000  8K rw--- libc.so.6
003ff7fc4000 52K rw---   [ anon ]
003ff7fdd000  8K rw---   [ anon ]
003ff7fdf000  4K r   [ anon ]
003ff7fe  4K r-x--   [ anon ]
003ff7fe1000112K r-x-- ld-linux-riscv64-lp64d.so.1
003ff7ffd000  4K r ld-linux-riscv64-lp64d.so.1
003ff7ffe000  8K rw--- ld-linux-riscv64-lp64d.so.1
003df000132K rw---   [ stack ]
 total 1516K
gdb-peda$ maintenance info sections 
Exec file: `/home/user/akhilesh/test', file type elf64-littleriscv.
 [0]  0x2aa270->0x2aa291 at 0x0270: .interp ALLOC LOAD READONLY
DATA HAS_CONTENTS
 [1]  0x2aa294->0x2aa2b8 at 0x0294: .note.gnu.build-id ALLOC
LOAD READONLY DATA HAS_CONTENTS
 [2]  0x2aa2b8->0x2aa2d8 at 0x02b8: .note.ABI-tag ALLOC LOAD
READONLY DATA HAS_CONTENTS
 [3]  0x2aa2d8->0x2aa2fc at 0x02d8: .gnu.hash ALLOC LOAD
READONLY DATA HAS_CONTENTS
 [4]  0x2aa300->0x2aa3d8 at 0x0300: .dynsym ALLOC LOAD READONLY
DATA HAS_CONTENTS
 [5]  0x2aa3d8->0x2aa45e at 0x03d8: .dynstr ALLOC LOAD 

[Bug ld/30877] [BUG][RISCV]relro protection not working in riscv

2023-09-22 Thread akhilesh.k at samsung dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30877

Akhilesh Kumar  changed:

   What|Removed |Added

 Target||RISC-V
   Severity|normal  |critical

-- 
You are receiving this mail because:
You are on the CC list for the bug.