Re: [GAS bug] .asciz inserts zero byte for each string passed

2024-05-30 Thread Andreas Schwab
On Mai 30 2024, Jiří Wolker wrote:

> As you can see at the byte 0x45, the NUL byte is placed after the first
> string ("hello" ends).

Which works as documented (`arguments not separated by commas').  See
also the comment: `Treat "a" "b" as "ab".  Even if we are appending
zeros.'

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Re: Possible bug - GAS for RSIC-V

2023-07-04 Thread Andreas Schwab
You haven't set up gp, or disable relaxation.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



Re: Stack BufferOverflow in readelf.c

2023-04-27 Thread Andreas Schwab
On Apr 27 2023, 2ourc3 1er wrote:

> The function includes a declaration of a fixed-sized buffer, *char
> name_buf[40];*, which is used later in the function with the *sprintf*
> function:* sprintf* (*name_buf*, "",
>   (unsigned int) *psym->st_shndx*);
>
> The problem with this implementation is that the st_shndx argument used in
> sprintf is controlled by the user, and therefore, could be larger than the
> size of the buffer, leading to a Stack BufferOverflow on the buffer
> *name_buf.*

That is obviously impossible: psym->st_shndx can be at most 65535, so it
cannot be larger than 4 characters when formatted as a hexadecimal
number.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Re: linking an assembler object creates an executable stack

2022-12-05 Thread Andreas Schwab
2.39

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



Re: linking an assembler object creates an executable stack

2022-12-05 Thread Andreas Schwab
On Dez 05 2022, Alexander Pick wrote:

> There is also no warning that the stack is executable during the
> process.

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: 
warning: test2.o: missing .note.GNU-stack section implies executable stack
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: NOTE: 
This behaviour is deprecated and will be removed in a future version of the 
linker

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



Re: mention about " --disable-nls"

2021-10-02 Thread Andreas Schwab
On Okt 02 2021, Kiyoshi KANAZAWA wrote:

> Installed binutils-2.37.
> Nothing is said about "--disable-nls" in configure script, although it works.
> It's better to mention about it.

$ ./configure --help=recursive | grep nls
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support
  --disable-nls   do not use Native Language Support

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



Re: How create small binaries with GNU binutils.

2019-02-01 Thread Andreas Schwab
On Feb 01 2019, Dmitry Bogatov  wrote:

> results in huge binary:
>
>   $ du -hb a.out
>   4744a.out
>   $ strip -s a.out
>   $ du -hb a.out
>   4408a.out
>   $ file a.out
>   a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically 
> linked, stripped

I cannot reproduce that.

$ stat -c %s a.out
664
$ strip a.out
$ stat -c %s a.out
344
$ size a.out 
   textdata bss dec hex filename
 13   0   0  13   d a.out
$ rpm -q binutils
binutils-2.31.90-lp150.5.68.1.x86_64

Try examining the files with `readelf -a'.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Is m68hc11 target still supported by gas?

2017-09-16 Thread Andreas Schwab
On Sep 16 2017, Marek Pietrzak <marekp...@gmail.com> wrote:

> test.o: file format elf32-m68hc11
>
> Disassembly of section .text:
>
>  :
>    0:    bd 00 00        jsr    0x0 
>    3:    20 0a       bra    0xf 
>     ...
>
> 000f :
>    f:    01      nop
>
> As you can see bra is generated correctly, but jsr is incorrect.

Look at the relocations.


test.o: file format elf32-m68hc11


Disassembly of section .text:

 :
   0:   bd 00 00jsr 0x0 
0: R_M68HC11_RL_JUMP*ABS*
1: R_M68HC11_16 a2
   3:   20 0a   bra 0xf 
3: R_M68HC11_RL_JUMP*ABS*
...

000f :
   f:   01  nop

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: objdump '--stop-address' option stop on a wrong ending address

2016-11-07 Thread Andreas Schwab
On Nov 07 2016, Nick Clifton <ni...@redhat.com> wrote:

> Hi Florian,
>
>> I try to extract function assembly code with objdump using
>> "--start-address" and "--stop-address" options but the stop address stop
>> on the second to last address.
>
>> $ objdump --start-address=0x50c40 --stop-address=0x50c5f -d
>
>>50c59:b8 01 00 00 00  mov$0x1,%eax
>>50c5e:c3  retq
>> 
>> As you can see the last address is wrong. The assembly code stop on
>> 0x50c5e instead of 0x50c5f.
>
> Actually this is the intended behaviour.  The --stop-address option 
> specifies the address at which objdump should *stop* displaying data.  
> So when objdump reaches address 50c5f it stops and does not display
> the disassembly for that address.
>
> In order to display the entire disassembly of a specific region you
> need to set the stop address to one more than the last address of the
> region concerned.

But note that the region does end at 0x50c5f, so there is nothing more
to disassemble anyway.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: binutils-2.26 configure doesn't fall back to 'ar' if it can't find 'x86_64-unknown-linux-gnu-ar'

2016-01-31 Thread Andreas Schwab
You didn't tell how you ran configure.  That usually happens if it
thinks that you are building with a cross compiler.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Can gold's max page size for AArch64 be updated to 64k to match current kernel capabilities?

2015-10-02 Thread Andreas Schwab
<http://permalink.gmane.org/gmane.comp.gnu.binutils/71259>

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: [PATCH] Typo in 'ar' help

2015-01-10 Thread Andreas Schwab
Ben Boeckel maths...@gmail.com writes:

 Attached is a patch for the 'ar' help of the '-M' option text
 '[mri-script]' which adds the closing angle bracket.

That's not a typo.  The script is expected on stdin.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Question about MSP430 assembler compiler

2014-11-01 Thread Andreas Schwab
Eugene eug...@pronan.zp.ua writes:

 Loop:  xor.b  #0b0101,P1OUT

gas/config/tc-msp430.h defines NUMBERS_WITH_SUFFIX, so this is the
number 0 with trailing garbage (which isn't properly diagnosed).  Use
0101B instead.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Configure script option checking does not work

2014-07-23 Thread Andreas Schwab
Jonas Wagner ltlygw...@gmail.com writes:

 The binutils configure script fails to check for unrecognized options:
 ./configure --enable-nonexisting-feature runs just fine.

This is deliberate, since the option may be accepted by a subdir
configure script.

 This is especially confusing as there are some configure options which are
 not documented, e.g., --enable-plugins or --enable-threads.

They are documented by the subdir configure scripts that recognize them.
Use --help=recursive to see them all.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
And now for something completely different.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Assumption about size of bfd_vma in opcodes/arm-dis.c

2013-07-19 Thread Andreas Schwab
Mathias Svensson frea...@freaken.dk writes:

 In multiple places in opcodes/arm-dis.c there is an implcit assumption
 that bfd_vma has the same size as an int. See for example lines
 2014-2033 in HEAD.

You are looking at some one year old sources, this has already been
fixed in 2012-07, in response to PR binutils/13135.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Wrong release date for binutils 2.21 - release date is 12/08/11

2011-03-29 Thread Andreas Schwab
Hulin, Gerlinde (E D EA SOL D TC1) gerlinde.hu...@siemens.com
writes:

 Hello,
 I have seen that the release date for  binutils 2.21 on 
 ftp://ftp.gnu.org/gnu/binutils is in the future


 12/08/11 09:58AM [GMT] 18,742,991 
 binutils-2.21.tar.bz2/gnu/binutils/binutils-2.21.tar.bz2

Must be a problem on your side, the timestamp on ftp.gnu.org is
2010-12-08.

ftp modtime binutils-2.21.tar.bz2
binutils-2.21.tar.bz2   12/08/2010 09:58:41 GMT

Andreas.

-- 
Andreas Schwab, sch...@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
And now for something completely different.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Error when building binutils

2010-05-19 Thread Andreas Schwab
joulnare18 joulnar...@hotmail.com writes:

 How can I do it?

Configure with --enable-maintainer-mode.

Andreas.

-- 
Andreas Schwab, sch...@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
And now for something completely different.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: ld segfaults on parisc

2009-03-19 Thread Andreas Schwab
Alexander Beregalov a.berega...@gmail.com writes:

 2009/3/17 Andreas Schwab sch...@linux-m68k.org:
 Could you please try this patch?

 Andreas.

 2009-03-17  Andreas Schwab  sch...@linux-m68k.org

        * elf32-hppa.c (final_link_relocate): Cast bfd_vma value to long
        for format string.

 It works, thanks!

Thanks for testing.

I have now checked this in as obvious.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: [Bug binutils/9769] [Build failure] tm struct tm_gmtoff field build error

2009-01-21 Thread Andreas Schwab
nickc at redhat dot com sourceware-bugzi...@sourceware.org writes:

   Actually I can see no good reason for using this unsupported field, so I am
 going to check in the attached patch to remove its use.

The result of localtime is now unused.  Also, the use of st_mtim is
nonportable, too.

Andreas.

-- 
Andreas Schwab, SuSE Labs, sch...@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Installation problems binutils-2.18 (part 2)

2008-07-08 Thread Andreas Schwab
wim [EMAIL PROTECTED] writes:

 [EMAIL PROTECTED]:/bin as --version
 GNU assembler 2.9
 Copyright 1997 Free Software Foundation, Inc.

SUSE Linux 8.0 originally came with binutils 2.11.92.0.10, which is
quite a bit newer than what you have, despite already being several
years old.  Also, it didn't provide the file /bin/as in the first place.

(Btw, putting . first in $PATH is a very bad thing to do. If you
really want . in $PATH you should at most put it last.)

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: gold: script_test_3.t output produces exec format error

2008-04-01 Thread Andreas Schwab
Ian Lance Taylor [EMAIL PROTECTED] writes:

 Jan Blunck [EMAIL PROTECTED] writes:

 Although the linker script looks ok, the resulting binary isn't executable on
 x86_64. Without defining the program headers in the linker script the
 executable is working fine.

See PR gold/5996

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Fixing m68k movec disassembly

2007-12-19 Thread Andreas Schwab
Jonathan S. Shapiro [EMAIL PROTECTED] writes:

 Also, my impression is that the target CPU *can* be specified on the
 command line (via -m), and in that case greater precision is possible.
 I'ld like to update the patch to deal with that. Assuming that the user
 has told us a CPU on the command line via -m, how can that cpu name be
 found from code running in opcodes/m68k-dis.c?

It's the bfd_mach value in info-mach.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: Relocation in generic ELF problem

2007-04-24 Thread Andreas Schwab
aniruddha [EMAIL PROTECTED] writes:

 make[1]: Leaving directory `/home/buildroot/build_arm/sysappl/C++'
 for i in C++ ; do  make -C $i || exit  ; done
 make[1]: Entering directory `/home/buildroot/build_arm/sysappl/C++'
 g++-c -o test1.o test1.cpp
 /home/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-g++ --static
 -o test1 test1.o

 /home/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.6/../../../../arm-linux-uclibc/bin/ld:
  test1.o: Relocatns in generic ELF (EM: 3)
 make[1]: *** [test1] Error 1
 make[1]: Leaving directory `/home/buildroot/build_arm/sysappl/C++'
 make: *** [all] Error 2

 wat is the solution to this problem?

Use the C++ cross compiler for your target.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: GOT error in gas

2007-02-12 Thread Andreas Schwab
Mikulas Patocka [EMAIL PROTECTED] writes:

 __asm__ (.global number; number = 0x12345678);
 extern void number;

These two declarations are not compatible.  The latter declares number as
a data symbol, but the former defines it is an absolute symbol.  Thus what
you get is undefined behaviour.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils